o
    f>hb[                     @   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G dd de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 ) SupportingDocumentInstancec                   @   s$   e Zd ZdZdZdZdZdZdZdS )z!SupportingDocumentInstance.StatusDRAFTPENDING_REVIEWREJECTEDAPPROVEDEXPIREDPROVISIONALLY_APPROVEDN)	__name__
__module____qualname__r   r   r   r   r   r    r   r   ^/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/trusthub/v1/supporting_document.pyStatus   s    r   Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	t
|d| _t
|d	| _|d
| _d|pM| ji| _d | _d S )Nr!   account_sidfriendly_name	mime_typestatustype
attributesdate_createddate_updatedurl)super__init__getr!   r"   r#   r$   r%   r&   r'   r
   iso8601_datetimer(   r)   r*   	_solution_context)selfr   r    r!   	__class__r   r   r,   0   s(   

z#SupportingDocumentInstance.__init__returnSupportingDocumentContextc                 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: SupportingDocumentContext for this SupportingDocumentInstance
        Nr!   r!   )r0   r5   _versionr/   r1   r   r   r   _proxyK   s   
z!SupportingDocumentInstance._proxyc                 C   
   | j  S )u
        Deletes the SupportingDocumentInstance


        :returns: True if delete succeeds, False otherwise
        )r9   deleter8   r   r   r   r<   Z      
z!SupportingDocumentInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the SupportingDocumentInstance


        :returns: True if delete succeeds, False otherwise
        N)r9   delete_asyncr8   r   r   r   r@   c      z'SupportingDocumentInstance.delete_asyncc                 C   r:   )q
        Fetch the SupportingDocumentInstance


        :returns: The fetched SupportingDocumentInstance
        )r9   fetchr8   r   r   r   rC   l   r=   z SupportingDocumentInstance.fetchc                    r>   )
        Asynchronous coroutine to fetch the SupportingDocumentInstance


        :returns: The fetched SupportingDocumentInstance
        N)r9   fetch_asyncr8   r   r   r   rE   u   rA   z&SupportingDocumentInstance.fetch_asyncr#   r'   c                 C   s   | j j||dS )a  
        Update the SupportingDocumentInstance

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

        :returns: The updated SupportingDocumentInstance
        r#   r'   )r9   updater1   r#   r'   r   r   r   rH   ~   s   z!SupportingDocumentInstance.updatec                    s   | j j||dI dH S ){  
        Asynchronous coroutine to update the SupportingDocumentInstance

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

        :returns: The updated SupportingDocumentInstance
        rG   N)r9   update_asyncrI   r   r   r   rK      s
   z'SupportingDocumentInstance.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>       z6SupportingDocumentInstance.__repr__.<locals>.<genexpr>z2<Twilio.Trusthub.V1.SupportingDocumentInstance {}>joinr/   itemsrR   r1   contextr   r   r   __repr__      
z#SupportingDocumentInstance.__repr__N)r4   r5   )r4   r   )r   r   r   objectr   r   r   strr   r   r,   propertyr9   boolr<   r@   rC   rE   r   unsetr   rH   rK   r^   __classcell__r   r   r2   r   r      sH    
	
	
	





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 )r5   r   r!   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the SupportingDocumentContext

        :param version: Version that contains the resource
        :param sid: The unique string created by Twilio to identify the Supporting Document resource.
        r!   z/SupportingDocuments/{sid}Nr   )r+   r,   r/   rR   _uri)r1   r   r!   r2   r   r   r,      s   z"SupportingDocumentContext.__init__r4   c                 C   s   t i }| jjd| j|dS )r;   DELETEmethoduriheaders)r   ofr7   r<   rg   r1   rl   r   r   r   r<      s   
z SupportingDocumentContext.deletec                    s&   t i }| jjd| j|dI dH S )r?   rh   ri   N)r   rm   r7   r@   rg   rn   r   r   r   r@      s
   
z&SupportingDocumentContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rB   application/jsonAcceptGETri   r!   r6   )r   rm   r7   rC   rg   r   r/   r1   rl   r    r   r   r   rC      s   
zSupportingDocumentContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rD   ro   rp   rq   ri   Nr!   r6   )r   rm   r7   rE   rg   r   r/   rr   r   r   r   rE      s   
z%SupportingDocumentContext.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 )
rF   FriendlyName
Attributes!application/x-www-form-urlencodedContent-Typero   rp   POSTrj   rk   datarl   r!   r6   )	r   rm   r   ra   r7   rH   rg   r   r/   r1   r#   r'   rz   rl   r    r   r   r   rH     s   

z SupportingDocumentContext.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 )rJ   rs   rv   rw   ro   rp   rx   ry   Nr!   r6   )	r   rm   r   ra   r7   rK   rg   r   r/   r{   r   r   r   rK   #  s   

z&SupportingDocumentContext.update_asyncc                 C   rL   )rM   rN   c                 s   rO   rP   rQ   rS   r   r   r   rW   K  rX   z5SupportingDocumentContext.__repr__.<locals>.<genexpr>z1<Twilio.Trusthub.V1.SupportingDocumentContext {}>rY   r\   r   r   r   r^   E  r_   z"SupportingDocumentContext.__repr__)r   r   r   r   rb   r,   rd   r<   r@   r   rC   rE   r   re   r   ra   rH   rK   r^   rf   r   r   r2   r   r5      s2    


$


"r5   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 )SupportingDocumentPager    r4   c                 C   s   t | j|S )zx
        Build an instance of SupportingDocumentInstance

        :param payload: Payload response from the API
        )r   r7   )r1   r    r   r   r   get_instanceQ  s   z#SupportingDocumentPage.get_instancec                 C      dS )rM   z+<Twilio.Trusthub.V1.SupportingDocumentPage>r   r8   r   r   r   r^   Y     zSupportingDocumentPage.__repr__N)	r   r   r   r   rb   r   r   r}   r^   r   r   r   r   r|   O  s    r|   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 )*SupportingDocumentListr   c                    s   t  | d| _dS )zt
        Initialize the SupportingDocumentList

        :param version: Version that contains the resource

        z/SupportingDocumentsN)r+   r,   rg   )r1   r   r2   r   r   r,   d  s   
zSupportingDocumentList.__init__r#   r&   r'   r4   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 SupportingDocumentInstance

        :param friendly_name: The string that you assigned to describe the resource.
        :param type: The type of the Supporting Document.
        :param attributes: The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types.

        :returns: The created SupportingDocumentInstance
        rt   Typeru   rw   rv   ro   rp   rx   ry   )r   rm   r   ra   r7   createrg   r   r1   r#   r&   r'   rz   rl   r    r   r   r   r   o  s   
zSupportingDocumentList.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 SupportingDocumentInstance

        :param friendly_name: The string that you assigned to describe the resource.
        :param type: The type of the Supporting Document.
        :param attributes: The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types.

        :returns: The created SupportingDocumentInstance
        r   rw   rv   ro   rp   rx   ry   N)r   rm   r   ra   r7   create_asyncrg   r   r   r   r   r   r     s   
z#SupportingDocumentList.create_asyncNlimit	page_sizec                 C   s0   | j ||}| j|d d}| j ||d S )ah  
        Streams SupportingDocumentInstance 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   )r7   read_limitspagestreamr1   r   r   limitsr   r   r   r   r     s   zSupportingDocumentList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )aw  
        Asynchronously streams SupportingDocumentInstance 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   )r7   r   
page_asyncstream_asyncr   r   r   r   r     s   z#SupportingDocumentList.stream_asyncc                 C   s   t | j||dS )a  
        Lists SupportingDocumentInstance 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   r1   r   r   r   r   r   r     s   zSupportingDocumentList.listc                    s&   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists SupportingDocumentInstance 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 r`   r   )rT   recordr   r   r   
<listcomp>  s
    z5SupportingDocumentList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r   
list_async  s   
z!SupportingDocumentList.list_async
page_tokenpage_numberc                 C   sJ   t |||d}t ddi}d|d< | jjd| j||d}t| j|S )a  
        Retrieve a single page of SupportingDocumentInstance 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 SupportingDocumentInstance
        	PageTokenr   PageSizerw   rv   ro   rp   rq   rj   rk   paramsrl   )r   rm   r7   r   rg   r|   r1   r   r   r   rz   rl   responser   r   r   r     s   
zSupportingDocumentList.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 SupportingDocumentInstance 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 SupportingDocumentInstance
        r   rw   rv   ro   rp   rq   r   N)r   rm   r7   r   rg   r|   r   r   r   r   r   =  s   
z!SupportingDocumentList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )a	  
        Retrieve a specific page of SupportingDocumentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SupportingDocumentInstance
        rq   )r7   domaintwiliorequestr|   r1   r   r   r   r   r   get_page^  s   	zSupportingDocumentList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of SupportingDocumentInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SupportingDocumentInstance
        rq   N)r7   r   r   request_asyncr|   r   r   r   r   get_page_asyncj  s   	z%SupportingDocumentList.get_page_asyncr!   c                 C      t | j|dS z
        Constructs a SupportingDocumentContext

        :param sid: The unique string created by Twilio to identify the Supporting Document resource.
        r6   r5   r7   r1   r!   r   r   r   r-   v     zSupportingDocumentList.getc                 C   r   r   r   r   r   r   r   __call__~  r   zSupportingDocumentList.__call__c                 C   r~   )rM   z+<Twilio.Trusthub.V1.SupportingDocumentList>r   r8   r   r   r   r^     r   zSupportingDocumentList.__repr__)NN) r   r   r   r   r,   r   re   rb   r   ra   r   r   r   r   intr   r   r	   r   r   r   r   r|   r   r   r   r   r5   r-   r   r^   rf   r   r   r2   r   r   b  s    

'

%







#



!r   N)__doc__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   r5   r|   r   r   r   r   r   <module>   s    $  $