U
    ^g%i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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
   Ziso8601_datetimer   r   r   	_solution_context)selfr   r   r   	__class__ _/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/trusthub/v1/end_user.pyr   %   s"     zEndUserInstance.__init__EndUserContextreturnc                 C   s&   | j dk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&   r/   K   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&   r1   T   s    zEndUserInstance.delete_asyncc                 C   s
   | j  S )[
        Fetch the EndUserInstance


        :returns: The fetched EndUserInstance
        )r-   fetchr,   r%   r%   r&   r3   ]   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&   r5   f   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&   r9   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
        r8   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>   s     z+EndUserInstance.__repr__.<locals>.<genexpr>z'<Twilio.Trusthub.V1.EndUserInstance {}>joinr    itemsrA   r"   contextr%   r%   r&   __repr__   s    zEndUserInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr-   boolr/   r1   r3   r5   r   unsetr   objectr9   r<   rL   __classcell__r%   r%   r#   r&   r      s8     
 			



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 | 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    rA   _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+   r/   rW   r"   r\   r%   r%   r&   r/      s    
zEndUserContext.deletec                    s$   t i }| jjd| j|dI dH S )r0   rX   rY   N)r   r]   r+   r1   rW   r^   r%   r%   r&   r1      s    
  zEndUserContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r2   application/jsonAcceptGETrY   r   r*   )r   r]   r+   r3   rW   r   r    r"   r\   r   r%   r%   r&   r3      s    
zEndUserContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r4   r_   r`   ra   rY   Nr   r*   )r   r]   r+   r5   rW   r   r    rb   r%   r%   r&   r5      s    
  zEndUserContext.fetch_asyncr6   c                 C   s\   t |t|d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r7   FriendlyName
Attributes!application/x-www-form-urlencodedContent-Typer_   r`   POSTrZ   r[   datar\   r   r*   )	r   r]   r   rU   r+   r9   rW   r   r    r"   r   r   rj   r\   r   r%   r%   r&   r9      s    
   zEndUserContext.updatec                    sb   t |t|d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r;   rc   rf   rg   r_   r`   rh   ri   Nr   r*   )	r   r]   r   rU   r+   r<   rW   r   r    rk   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?   r@   rB   r%   r%   r&   rF   8  s     z*EndUserContext.__repr__.<locals>.<genexpr>z&<Twilio.Trusthub.V1.EndUserContext {}>rG   rJ   r%   r%   r&   rL   2  s    zEndUserContext.__repr__)rM   rN   rO   r   rQ   r   rS   r/   r1   r   r3   r5   r   rT   r   rU   r9   r<   rL   rV   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%   r&   get_instance>  s    zEndUserPage.get_instancer(   c                 C   s   dS )r=   z <Twilio.Trusthub.V1.EndUserPage>r%   r,   r%   r%   r&   rL   F  s    zEndUserPage.__repr__N)	rM   rN   rO   r   rQ   r   r   rm   rL   r%   r%   r%   r&   rl   <  s   rl   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   rW   )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
        rd   Typere   rg   rf   r_   r`   rh   ri   )r   r]   r   rU   r+   createrW   r   r"   r   r   r   rj   r\   r   r%   r%   r&   rq   \  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
        ro   rg   rf   r_   r`   rh   ri   N)r   r]   r   rU   r+   create_asyncrW   r   rr   r%   r%   r&   rs     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
        ru   ru   rt   )r+   read_limitspagestreamr"   rt   ru   Zlimitsrx   r%   r%   r&   ry     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
        ru   rv   Nrt   )r+   rw   
page_asyncstream_asyncrz   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
        rt   ru   )listry   r"   rt   ru   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 )Nr%   )rC   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_numberru   r)   c                 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
        Z	PageTokenr   ZPageSizerg   rf   r_   r`   ra   rZ   r[   paramsr\   )r   r]   r+   rx   rW   rl   r"   r   r   ru   rj   r\   responser%   r%   r&   rx   	  s       zEndUserList.pagec                    sP   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   rg   rf   r_   r`   ra   r   N)r   r]   r+   r{   rW   rl   r   r%   r%   r&   r{   *  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
        ra   )r+   domaintwiliorequestrl   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
        ra   N)r+   r   r   Zrequest_asyncrl   r   r%   r%   r&   get_page_asyncW  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   c  s    zEndUserList.getc                 C   s   t | j|dS r   r   r   r%   r%   r&   __call__k  s    zEndUserList.__call__r(   c                 C   s   dS )r=   z <Twilio.Trusthub.V1.EndUserList>r%   r,   r%   r%   r&   rL   s  s    zEndUserList.__repr__)NN)NN)NN)NN) rM   rN   rO   r   r   r   rT   rQ   r   rU   r   rq   rs   r   intr   ry   r	   r|   r   r~   r   rl   rx   r{   r   r   r'   r   r   rL   rV   r%   r%   r#   r&   rn   O  s   
'
%        


#


!rn   N)rP   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'   rl   rn   r%   r%   r%   r&   <module>   s   $   