o
    f>h@                     @   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dedeeef dede	e f fdd	Z
edddZdddZdddZd
efddZ  ZS )FlowRevisionInstancec                   @   s   e Zd ZdZdZdS )zFlowRevisionInstance.Statusdraft	publishedN)__name__
__module____qualname__DRAFT	PUBLISHED r   r   [/var/www/html/venv/lib/python3.10/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&   iso8601_datetimer'   r(   r)   	_solution_context)selfr   r   r   r   	__class__r   r   r,   .   s*   
zFlowRevisionInstance.__init__returnFlowRevisionContextc                 C   s.   | j du 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*   )r1   r6   _versionr0   r2   r   r   r   _proxyN   s   
zFlowRevisionInstance._proxyc                 C   s
   | j  S )e
        Fetch the FlowRevisionInstance


        :returns: The fetched FlowRevisionInstance
        )r9   fetchr8   r   r   r   r;   ^   s   
zFlowRevisionInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the FlowRevisionInstance


        :returns: The fetched FlowRevisionInstance
        N)r9   fetch_asyncr8   r   r   r   r=   g   s   z FlowRevisionInstance.fetch_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>v       z0FlowRevisionInstance.__repr__.<locals>.<genexpr>z*<Twilio.Studio.V2.FlowRevisionInstance {}>joinr0   itemsrD   r2   contextr   r   r   __repr__p      
zFlowRevisionInstance.__repr__N)r5   r6   )r5   r   )r   r   r   objectr   r   r   strr   r   r,   propertyr9   r;   r=   rP   __classcell__r   r   r3   r   r      s$    
 

		r   c                       sT   e Zd Zde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	  Z
S )r6   r   r   r   c                    s0   t  | ||d| _djdi | 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}Nr   r+   r,   r0   rD   _uri)r2   r   r   r   r3   r   r   r,   |   s
   zFlowRevisionContext.__init__r5   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r:   application/jsonAcceptGETmethoduriheadersr   r   r*   )r   ofr7   r;   rX   r   r0   r2   r_   r   r   r   r   r;      s   
zFlowRevisionContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r<   rY   rZ   r[   r\   Nr   r   r*   )r   r`   r7   r=   rX   r   r0   ra   r   r   r   r=      s   
zFlowRevisionContext.fetch_asyncc                 C   r>   )r?   r@   c                 s   rA   rB   rC   rE   r   r   r   rI      rJ   z/FlowRevisionContext.__repr__.<locals>.<genexpr>z)<Twilio.Studio.V2.FlowRevisionContext {}>rK   rN   r   r   r   rP      rQ   zFlowRevisionContext.__repr__)r   r   r   r   rT   r,   r   r;   r=   rP   rV   r   r   r3   r   r6   z   s
    r6   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 )FlowRevisionPager   r5   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   r7   r0   )r2   r   r   r   r   get_instance   s   zFlowRevisionPage.get_instancec                 C      dS )r?   z#<Twilio.Studio.V2.FlowRevisionPage>r   r8   r   r   r   rP         zFlowRevisionPage.__repr__N)	r   r   r   r   rT   r   r   rc   rP   r   r   r   r   rb      s    rb   c                	       s  e Zd Zdedef 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 )$FlowRevisionListr   r   c                    s.   t  | d|i| _djdi | 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}/RevisionsNr   rW   )r2   r   r   r3   r   r   r,      s   zFlowRevisionList.__init__Nlimit	page_sizer5   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
        rh   rh   rg   )r7   read_limitspagestreamr2   rg   rh   limitsrk   r   r   r   rl      s   zFlowRevisionList.streamc                    s8   | 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
        rh   ri   Nrg   )r7   rj   
page_asyncstream_asyncrm   r   r   r   rp     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
        rg   rh   )listrl   r2   rg   rh   r   r   r   rr     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 rR   r   )rF   recordr   r   r   
<listcomp>G  s
    z/FlowRevisionList.list_async.<locals>.<listcomp>rq   N)rp   rs   r   r   r   
list_async4  s   
zFlowRevisionList.list_async
page_tokenpage_numberc                 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
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrY   rZ   r[   r]   r^   paramsr_   )r   r`   r7   rk   rX   rb   r0   r2   rw   rx   rh   datar_   responser   r   r   rk   O  s   
zFlowRevisionList.pagec                    sV   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
        ry   r|   r}   rY   rZ   r[   r~   N)r   r`   r7   ro   rX   rb   r0   r   r   r   r   ro   p  s   
zFlowRevisionList.page_async
target_urlc                 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
        r[   )r7   domaintwiliorequestrb   r0   r2   r   r   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
        r[   N)r7   r   r   request_asyncrb   r0   r   r   r   r   get_page_async  s   	zFlowRevisionList.get_page_asyncr   c                 C      t | j| jd |dS z
        Constructs a FlowRevisionContext

        :param revision: Specific Revision number or can be `LatestPublished` and `LatestRevision`.
        r   r*   r6   r7   r0   r2   r   r   r   r   r-        zFlowRevisionList.getc                 C   r   r   r   r   r   r   r   __call__  r   zFlowRevisionList.__call__c                 C   rd   )r?   z#<Twilio.Studio.V2.FlowRevisionList>r   r8   r   r   r   rP     re   zFlowRevisionList.__repr__)NN)r   r   r   r   rT   r,   r   intr   r   rl   r	   rp   r   rr   rv   r   unsetr   rS   rb   rk   ro   r   r   r6   r-   r   rP   rV   r   r   r3   r   rf      s    







#



!

rf   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r6   rb   rf   r   r   r   r   <module>   s    $aI