
    d{i8e                         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 dd
lmZ  G d de      Z G d de      Z G d de      Z G d de      Zy)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)ApiResponse)InstanceContext)InstanceResource)ListResource)Version)Pagec            
            e Zd Z G d de      Z	 	 ddedeeef   dede	e   f fdZ
edd	       Zdd
ZddZdefdZdefdZdefdZ xZS )FlowRevisionInstancec                       e Zd ZdZdZy)FlowRevisionInstance.Statusdraft	publishedN)__name__
__module____qualname__DRAFT	PUBLISHED     f/home/sas/my/fyp/ringai/.venv/lib/python3.12/site-packages/twilio/rest/studio/v2/flow/flow_revision.pyStatusr      s    	r   r!   versionpayloadsidrevisionc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        t        j                  |j                  d
            | _        t        j                  |j                  d            | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )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/   r0   	_solution_context)selfr"   r#   r$   r%   	__class__s        r    r3   zFlowRevisionInstance.__init__/   s&    	!")++e"4*1++m*D,3KK,H7>{{<7P?F{{8?T'2':':7;;z;R'S-4[[9I-J%,[[%9
9@X9N0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4  1DMM
 8<r   returnc                     | j                   7t        | j                  | j                  d   | j                  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
        r$   r%   r1   )r8   FlowRevisionContext_versionr7   r9   s    r    _proxyzFlowRevisionInstance._proxyO   sE     == /NN5)
3DM
 }}r   c                 6    | j                   j                         S )e
        Fetch the FlowRevisionInstance


        :returns: The fetched FlowRevisionInstance
        )r@   fetchr?   s    r    rC   zFlowRevisionInstance.fetch_   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine to fetch the FlowRevisionInstance


        :returns: The fetched FlowRevisionInstance
        N)r@   fetch_asyncr?   s    r    rF   z FlowRevisionInstance.fetch_asynch   s!      [[,,....   '%'c                 6    | j                   j                         S )z
        Fetch the FlowRevisionInstance with HTTP info


        :returns: ApiResponse with instance, status code, and headers
        )r@   fetch_with_http_infor?   s    r    rI   z)FlowRevisionInstance.fetch_with_http_infoq   s     {{//11r   c                 R   K   | j                   j                          d{   S 7 w)z
        Asynchronous coroutine to fetch the FlowRevisionInstance with HTTP info


        :returns: ApiResponse with instance, status code, and headers
        N)r@   fetch_with_http_info_asyncr?   s    r    rK   z/FlowRevisionInstance.fetch_with_http_info_asyncz   s!      [[;;====rG   c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r    	<genexpr>z0FlowRevisionInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z*<Twilio.Studio.V2.FlowRevisionInstance {}>joinr7   itemsrR   r9   contexts     r    __repr__zFlowRevisionInstance.__repr__   s6     ((SDNN<P<P<RSS;BB7KKr   )N)r;   r=   )r;   r   )r   r   r   objectr!   r   r   strr   r   r3   propertyr@   rC   rF   r   rI   rK   r_   __classcell__r:   s   @r    r   r      s       ( #'<< c3h< 	<
 3-<@  #/2k 2>+ >L# Lr   r   c                        e Zd Zdededef fdZdefdZdefdZ	de
fdZdefd	Zdefd
Zde
fdZdefdZ xZS )r=   r"   r$   r%   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)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`.
        r1   z!/Flows/{sid}/Revisions/{revision}Nr   r2   r3   r7   rR   _uri)r9   r"   r$   r%   r:   s       r    r3   zFlowRevisionContext.__init__   sA     	!  
 ?7>>PP	r   r;   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      S )zz
        Internal helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        application/jsonAcceptGETmethoduriheaders)r   ofr>   fetch_with_response_inforh   r9   rp   s     r    _fetchzFlowRevisionContext._fetch   sB     ))B-.}}55dii 6 
 	
r   c                     | j                         \  }}}t        | j                  || j                  d   | j                  d         S )rB   r$   r%   r1   )rt   r   r>   r7   r9   r#   _s      r    rC   zFlowRevisionContext.fetch   sD     A#MMu%^^J/	
 	
r   c                     | j                         \  }}}t        | j                  || j                  d   | j                  d         }t	        |||      S )z
        Fetch the FlowRevisionInstance and return response metadata


        :returns: ApiResponse with instance, status code, and headers
        r$   r%   r1   datastatus_coderp   )rt   r   r>   r7   r   r9   r#   r{   rp   instances        r    rI   z(FlowRevisionContext.fetch_with_http_info   sS     )-%g'MMu%^^J/	
 k7SSr   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   S 7 w)z
        Internal async helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        rj   rk   rl   rm   N)r   rq   r>   fetch_with_response_info_asyncrh   rs   s     r    _fetch_asyncz FlowRevisionContext._fetch_async   sQ      ))B-.]]AAdii B 
 
 	
 
s   AAA	Ac                    K   | j                          d{   \  }}}t        | j                  || j                  d   | j                  d         S 7 ;w)rE   Nr$   r%   r1   )r   r   r>   r7   rv   s      r    rF   zFlowRevisionContext.fetch_async   sS      #//11A#MMu%^^J/	
 	
 2s   AA<Ac                    K   | j                          d{   \  }}}t        | j                  || j                  d   | j                  d         }t	        |||      S 7 Iw)z
        Asynchronous coroutine to fetch the FlowRevisionInstance and return response metadata


        :returns: ApiResponse with instance, status code, and headers
        Nr$   r%   r1   ry   )r   r   r>   r7   r   r|   s        r    rK   z.FlowRevisionContext.fetch_with_http_info_async   sc      /3.?.?.A(A%g'MMu%^^J/	
 k7SS )Bs   A"A A
A"c                     dj                  d | j                  j                         D              }dj                  |      S )rM   rN   c              3   F   K   | ]  \  }}d j                  ||        ywrP   rQ   rS   s      r    rW   z/FlowRevisionContext.__repr__.<locals>.<genexpr>  rX   rY   z)<Twilio.Studio.V2.FlowRevisionContext {}>rZ   r]   s     r    r_   zFlowRevisionContext.__repr__   s6     ((SDNN<P<P<RSS:AA'JJr   )r   r   r   r   ra   r3   tuplert   r   rC   r   rI   r   rF   rK   r_   rc   rd   s   @r    r=   r=      s}    Q Qc QS Q"
 
 
+ 
Tk T 
E 
 
#7 
T+ T K# Kr   r=   c                   2    e Zd Zdeeef   defdZdefdZy)FlowRevisionPager#   r;   c                 L    t        | j                  || j                  d         S )zr
        Build an instance of FlowRevisionInstance

        :param payload: Payload response from the API
        r$   )r$   )r   r>   r7   )r9   r#   s     r    get_instancezFlowRevisionPage.get_instance
  s      $DMM7u@UVVr   c                      y)rM   z#<Twilio.Studio.V2.FlowRevisionPage>r   r?   s    r    r_   zFlowRevisionPage.__repr__       5r   N)	r   r   r   r   ra   r   r   r   r_   r   r   r    r   r     s-    WDcN W7K W5# 5r   r   c            	           e Zd Zdedef fdZ	 	 ddee   dee   dee	   fdZ
	 	 ddee   dee   dee	   fdZ	 	 ddee   dee   defd	Z	 	 ddee   dee   defd
Z	 	 ddee   dee   dee	   fdZ	 	 ddee   dee   dee	   fdZ	 	 ddee   dee   defdZ	 	 ddee   dee   def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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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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ZdedefdZdedefdZ dede!fdZ"dede!fdZ#defdZ$ xZ%S )FlowRevisionListr"   r$   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)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   rg   )r9   r"   r$   r:   s      r    r3   zFlowRevisionList.__init__  s@     	! 3
 4,33EdnnE	r   limit	page_sizer;   c                     | j                   j                  ||      }| j                  |d         }| j                   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   )r>   read_limitspagestreamr9   r   r   limitsr   s        r    r   zFlowRevisionList.stream-  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)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   )r>   r   
page_asyncstream_asyncr   s        r    r   zFlowRevisionList.stream_asyncF  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                     | j                   j                  ||      }| j                  |d         }| j                   j                  |j                  |d         }||j
                  |j                  fS )a  
        Streams FlowRevisionInstance and returns headers from first page


        :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: tuple of (generator, status_code, headers) where generator yields instances
        r   r   r   )r>   r   page_with_http_infor   rz   r{   rp   r9   r   r   r   page_response	generators         r    stream_with_http_infoz&FlowRevisionList.stream_with_http_info_  sk    $ **5)<006+;N0OMM((););VG_M	=44m6K6KLLr   c                   K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  |j                  |d         }||j
                  |j                  fS 7 Fw)a  
        Asynchronously streams FlowRevisionInstance and returns headers from first page


        :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: tuple of (generator, status_code, headers) where generator yields instances
        r   r   Nr   )r>   r   page_with_http_info_asyncr   rz   r{   rp   r   s         r    stream_with_http_info_asyncz,FlowRevisionList.stream_with_http_info_asyncw  s     $ **5)<"<<[) = 
 
 MM..}/A/A6'?S	=44m6K6KLL
s   5B A>AB c                 :    t        | j                  ||            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   )listr   )r9   r   r   s      r    r   zFlowRevisionList.list  s(    & KK#  
 	
r   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)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
        r   N)r   )r9   r   r   records       r    
list_asynczFlowRevisionList.list_async  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;c                 b    | j                  ||      \  }}}t        |      }t        |||      S )a  
        Lists FlowRevisionInstance and returns headers from first page


        :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: ApiResponse with list of instances, status code, and headers
        r   ry   )r   r   r   )r9   r   r   r   r{   rp   r\   s          r    list_with_http_infoz$FlowRevisionList.list_with_http_info  sA    $ +/*D*D +E +
'	; Y;PPr   c                    K   | j                  ||       d{   \  }}}|2 cg c3 d{   }|7 7 	6 nc c}w }}t        |||      S w)a  
        Asynchronously lists FlowRevisionInstance and returns headers from first page


        :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: ApiResponse with list of instances, status code, and headers
        r   Nry   )r   r   )r9   r   r   r   r{   rp   r   r\   s           r    list_with_http_info_asyncz*FlowRevisionList.list_with_http_info_async  sf     $ 150P0P 1Q 1
 +
'	; -666&	+
 7666;PPs4   A4A:86
8:A8:A
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }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-urlencodedrj   rk   rl   rn   ro   paramsrp   )r   rq   r>   r   rh   r   r7   r9   r   r   r   rz   rp   responses          r    r   zFlowRevisionList.page  s      yy'#%
 ))^-PQR.==%%diig & 
  xHHr   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	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
        r   r   r   rj   rk   rl   r   N)r   rq   r>   r   rh   r   r7   r   s          r    r   zFlowRevisionList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
  xHH
s   A"B$B
%&Bc                 $   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      \  }}}t        | j                  || j                        }	t        |	||      S )	a^  
        Retrieve a single page with response metadata


        :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: ApiResponse with FlowRevisionPage, status code, and headers
        r   r   r   rj   rk   rl   r   ry   )r   rq   r>   page_with_response_inforh   r   r7   r   
r9   r   r   r   rz   rp   r   r{   response_headersr   s
             r    r   z$FlowRevisionList.page_with_http_info:  s      yy'#%
 ))^-PQR.26--2W2Wdiig 3X 3
/+/  xH+GWXXr   c                 @  K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   \  }}}t        | j                  || j                        }	t        |	||	      S 7 7w)
am  
        Asynchronously retrieve a single page with response metadata


        :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: ApiResponse with FlowRevisionPage, status code, and headers
        r   r   r   rj   rk   rl   r   Nry   )r   rq   r>   page_with_response_info_asyncrh   r   r7   r   r   s
             r    r   z*FlowRevisionList.page_with_http_info_async\  s       yy'#%
 ))^-PQR. --==$))D' >   	0+/
  xH+GWXXs   A"B$B%8B
target_urlc                     | j                   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
        rl   )r>   domaintwiliorequestr   r7   r9   r   r   s      r    get_pagezFlowRevisionList.get_page  s=     ==''..66ujIxHHr   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)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
        rl   N)r>   r   r   request_asyncr   r7   r   s      r    get_page_asynczFlowRevisionList.get_page_async  sJ      --44BB5*UUxHH Vs   4AA&Ar%   c                 L    t        | j                  | j                  d   |      S z
        Constructs a FlowRevisionContext

        :param revision: Specific Revision number or can be `LatestPublished` and `LatestRevision`.
        r$   r1   r=   r>   r7   r9   r%   s     r    r4   zFlowRevisionList.get  %     #MMt~~e4x
 	
r   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r    __call__zFlowRevisionList.__call__  r   r   c                      y)rM   z#<Twilio.Studio.V2.FlowRevisionList>r   r?   s    r    r_   zFlowRevisionList.__repr__  r   r   )NN)&r   r   r   r   ra   r3   r   intr	   r   r   r
   r   r   r   r   r   r   r   r   r   r   r   unsetr   r`   r   r   r   r   r   r   r   r=   r4   r   r_   rc   rd   s   @r    r   r     s   F Fc F$  $#';}; C=; 
&	'	;6  $#'A}A C=A 
+	,	A6  $#'M}M C=M 
	M4  $#'M}M C=M 
	M8  $#'
}
 C=
 
"	#	
8  $#'
}
 C=
 
"	#	
:  $#'Q}Q C=Q 
	Q6  $#'Q}Q C=Q 
	Q6 *0*0,,(.	I#v+&I 3;'I f%	I
 
IF *0*0,,(.	I#v+&I 3;'I f%	I
 
IF *0*0,,(.	 Y#v+& Y 3;' Y f%	 Y
 
 YH *0*0,,(.	"Y#v+&"Y 3;'"Y f%	"Y
 
"YH
I3 
I+; 
I
Is 
I7G 
I
C 
$7 

 
)< 
5# 5r   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   twilio.base.api_responser   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r=   r   r   r   r   r    <module>r      sj     L L L + 0 8 : 2 ' !pL+ pLfxK/ xKv5t 5&W5| W5r   