U
    ^g%i@                     @   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 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 - Studio
    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values)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZG dd deZdeeeef ee	e d fddZ
eddd	d
Zd dddZd dddZedddZ  ZS )FlowRevisionInstancec                   @   s   e Zd ZdZdZdS )zFlowRevisionInstance.StatusZdraftZ	publishedN)__name__
__module____qualname__ZDRAFTZ	PUBLISHED r   r   g/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/studio/v2/flow/flow_revision.pyStatus   s   r   N)versionpayloadsidrevisionc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
|d| _|d| _|d	| _t|d
| _t|d| _|d| _||p| j
d| _d | _d S )Nr   account_sidfriendly_name
definitionstatusr   commit_messagevaliderrorsdate_createddate_updatedurlr   r   )super__init__getr   r   r   r   r   r
   integerr   r    r!   r"   Ziso8601_datetimer#   r$   r%   	_solution_context)selfr   r   r   r   	__class__r   r   r(   .   s*    zFlowRevisionInstance.__init__FlowRevisionContextreturnc                 C   s.   | j dkr(t| j| jd | 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: FlowRevisionContext for this FlowRevisionInstance
        Nr   r   r&   )r,   r0   _versionr+   r-   r   r   r   _proxyN   s    
zFlowRevisionInstance._proxyc                 C   s
   | j  S )e
        Fetch the FlowRevisionInstance


        :returns: The fetched FlowRevisionInstance
        )r5   fetchr4   r   r   r   r7   ^   s    zFlowRevisionInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the FlowRevisionInstance


        :returns: The fetched FlowRevisionInstance
        N)r5   fetch_asyncr4   r   r   r   r9   g   s    z FlowRevisionInstance.fetch_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>v   s     z0FlowRevisionInstance.__repr__.<locals>.<genexpr>z*<Twilio.Studio.V2.FlowRevisionInstance {}>joinr+   itemsr>   r-   contextr   r   r   __repr__p   s    zFlowRevisionInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r(   propertyr5   r7   r9   rI   __classcell__r   r   r.   r   r      s    
 		r   c                       sP   e Zd Zeeed fddZedddZedddZedd	d
Z	  Z
S )r0   )r   r   r   c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the FlowRevisionContext

        :param version: Version that contains the resource
        :param sid: The SID of the Flow resource to fetch.
        :param revision: Specific Revision number or can be `LatestPublished` and `LatestRevision`.
        r&   z!/Flows/{sid}/Revisions/{revision}Nr'   r(   r+   r>   _uri)r-   r   r   r   r.   r   r   r(   |   s
    zFlowRevisionContext.__init__r1   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r6   application/jsonAcceptGETmethoduriheadersr   r   r&   )r   ofr3   r7   rO   r   r+   r-   rV   r   r   r   r   r7      s    
zFlowRevisionContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r8   rP   rQ   rR   rS   Nr   r   r&   )r   rW   r3   r9   rO   r   r+   rX   r   r   r   r9      s    
  zFlowRevisionContext.fetch_asyncc                 C   s$   d dd | j D }d|S )r:   r;   c                 s   s   | ]\}}d  ||V  qdS r<   r=   r?   r   r   r   rC      s     z/FlowRevisionContext.__repr__.<locals>.<genexpr>z)<Twilio.Studio.V2.FlowRevisionContext {}>rD   rG   r   r   r   rI      s    zFlowRevisionContext.__repr__)r   r   r   r   rK   r(   r   r7   r9   rI   rM   r   r   r.   r   r0   z   s   r0   c                   @   s2   e Zd Zeeef edddZedddZdS )FlowRevisionPage)r   r2   c                 C   s   t | j|| jd dS )zr
        Build an instance of FlowRevisionInstance

        :param payload: Payload response from the API
        r   )r   )r   r3   r+   )r-   r   r   r   r   get_instance   s    zFlowRevisionPage.get_instancer1   c                 C   s   dS )r:   z#<Twilio.Studio.V2.FlowRevisionPage>r   r4   r   r   r   rI      s    zFlowRevisionPage.__repr__N)	r   r   r   r   rK   r   r   rZ   rI   r   r   r   r   rY      s   rY   c                       sf  e Zd Zeed f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 )$FlowRevisionList)r   r   c                    s*   t  | d|i| _djf | j| _dS )z
        Initialize the FlowRevisionList

        :param version: Version that contains the resource
        :param sid: The SID of the Flow resource to fetch.

        r   z/Flows/{sid}/RevisionsNrN   )r-   r   r   r.   r   r   r(      s
     zFlowRevisionList.__init__N)limit	page_sizer2   c                 C   s0   | j ||}| j|d d}| j ||d S )ab  
        Streams FlowRevisionInstance 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\   )r3   read_limitspagestreamr-   r\   r]   Zlimitsr`   r   r   r   ra      s    zFlowRevisionList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )aq  
        Asynchronously streams FlowRevisionInstance 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\   )r3   r_   
page_asyncstream_asyncrb   r   r   r   rd     s    zFlowRevisionList.stream_asyncc                 C   s   t | j||dS )a  
        Lists FlowRevisionInstance 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]   )listra   r-   r\   r]   r   r   r   rf     s    zFlowRevisionList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists FlowRevisionInstance 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   )r@   recordr   r   r   
<listcomp>G  s   z/FlowRevisionList.list_async.<locals>.<listcomp>re   N)rd   rg   r   r   r   
list_async4  s    
zFlowRevisionList.list_async)
page_tokenpage_numberr]   r2   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a}  
        Retrieve a single page of FlowRevisionInstance 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 FlowRevisionInstance
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrP   rQ   rR   rT   rU   paramsrV   )r   rW   r3   r`   rO   rY   r+   r-   rk   rl   r]   datarV   responser   r   r   r`   O  s       zFlowRevisionList.pagec                    sT   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of FlowRevisionInstance 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 FlowRevisionInstance
        rm   rn   ro   rP   rQ   rR   rp   N)r   rW   r3   rc   rO   rY   r+   rr   r   r   r   rc   p  s       zFlowRevisionList.page_async)
target_urlr2   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of FlowRevisionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FlowRevisionInstance
        rR   )r3   domaintwiliorequestrY   r+   r-   ru   rt   r   r   r   get_page  s    	zFlowRevisionList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of FlowRevisionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of FlowRevisionInstance
        rR   N)r3   rv   rw   Zrequest_asyncrY   r+   ry   r   r   r   get_page_async  s    	zFlowRevisionList.get_page_async)r   r2   c                 C   s   t | j| jd |dS z
        Constructs a FlowRevisionContext

        :param revision: Specific Revision number or can be `LatestPublished` and `LatestRevision`.
        r   r&   r0   r3   r+   r-   r   r   r   r   r)     s
      zFlowRevisionList.getc                 C   s   t | j| jd |dS r|   r}   r~   r   r   r   __call__  s
      zFlowRevisionList.__call__r1   c                 C   s   dS )r:   z#<Twilio.Studio.V2.FlowRevisionList>r   r4   r   r   r   rI     s    zFlowRevisionList.__repr__)NN)NN)NN)NN)r   r   r   r   rK   r(   r   intr   r   ra   r	   rd   r   rf   rj   r   unsetr   rJ   rY   r`   rc   rz   r{   r0   r)   r   rI   rM   r   r   r.   r   r[      sh           


#


!

r[   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   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   r0   rY   r[   r   r   r   r   <module>   s   $aI