
    pi@                         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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)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 xZS )FlowRevisionInstancec                       e Zd ZdZdZy)FlowRevisionInstance.Statusdraft	publishedN)__name__
__module____qualname__DRAFT	PUBLISHED     j/opt/services/ai/voice_agent/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.   r/   	_solution_context)selfr!   r"   r#   r$   	__class__s        r   r2   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$   r0   )r7   FlowRevisionContext_versionr6   r8   s    r   _proxyzFlowRevisionInstance._proxyN   sE     == /NN5)
3DM
 }}r   c                 6    | j                   j                         S )e
        Fetch the FlowRevisionInstance


        :returns: The fetched FlowRevisionInstance
        )r?   fetchr>   s    r   rB   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   rE   z FlowRevisionInstance.fetch_asyncg   s!      [[,,....s   '%'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>v        SDAq7>>!Q/S   !z*<Twilio.Studio.V2.FlowRevisionInstance {}>joinr6   itemsrL   r8   contexts     r   __repr__zFlowRevisionInstance.__repr__p   s6     ((SDNN<P<P<RSS;BB7KKr   )N)r:   r<   )r:   r   )r   r   r   objectr    r   r   strr   r   r2   propertyr?   rB   rE   rY   __classcell__r9   s   @r   r   r      s}       ( #'<< c3h< 	<
 3-<@  #/L# Lr   r   c                   P     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	 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`.
        r0   z!/Flows/{sid}/Revisions/{revision}Nr   r1   r2   r6   rL   _uri)r8   r!   r#   r$   r9   s       r   r2   zFlowRevisionContext.__init__|   sA     	!  
 ?7>>PP	r   r:   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d   | j                  d         S )rA   application/jsonAcceptGETmethoduriheadersr#   r$   r0   )r   ofr=   rB   rb   r   r6   r8   rj   r"   s      r   rB   zFlowRevisionContext.fetch   si     ))B-.--%%U		7%S#MMu%^^J/	
 	
r   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rD   rd   re   rf   rg   Nr#   r$   r0   )r   rk   r=   rE   rb   r   r6   rl   s      r   rE   zFlowRevisionContext.fetch_async   s~      ))B-.11dii 2 
 
 $MMu%^^J/	
 	
	
s   ABB 	8Bc                     dj                  d | j                  j                         D              }dj                  |      S )rG   rH   c              3   F   K   | ]  \  }}d j                  ||        ywrJ   rK   rM   s      r   rQ   z/FlowRevisionContext.__repr__.<locals>.<genexpr>   rR   rS   z)<Twilio.Studio.V2.FlowRevisionContext {}>rT   rW   s     r   rY   zFlowRevisionContext.__repr__   s6     ((SDNN<P<P<RSS:AA'JJr   )r   r   r   r   r[   r2   r   rB   rE   rY   r]   r^   s   @r   r<   r<   z   sI    Q Qc QS Q"
+ 
*
#7 
.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=   r6   )r8   r"   s     r   get_instancezFlowRevisionPage.get_instance   s      $DMM7u@UVVr   c                      y)rG   z#<Twilio.Studio.V2.FlowRevisionPage>r   r>   s    r   rY   zFlowRevisionPage.__repr__        5r   N)	r   r   r   r   r[   r   r   rs   rY   r   r   r   rq   rq      s-    WDcN W7K W5# 5r   rq   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e	   fd	Z	 	 ddee   dee   de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   ra   )r8   r!   r#   r9   s      r   r2   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
        rz   rz   ry   )r=   read_limitspagestreamr8   ry   rz   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
        rz   r|   Nry   )r=   r}   
page_asyncstream_asyncr   s        r   r   zFlowRevisionList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$A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
        ry   rz   )listr   )r8   ry   rz   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   )r8   ry   rz   records       r   
list_asynczFlowRevisionList.list_async4  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
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-urlencodedrd   re   rf   rh   ri   paramsrj   )r   rk   r=   r~   rb   rq   r6   r8   r   r   rz   datarj   responses          r   r~   zFlowRevisionList.pageO  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   rd   re   rf   r   N)r   rk   r=   r   rb   rq   r6   r   s          r   r   zFlowRevisionList.page_asyncp  s       yy'#%
 ))^-PQR.11diig 2 
 
  xHH
s   A"B$B
%&B
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
        rf   )r=   domaintwiliorequestrq   r6   r8   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
        rf   N)r=   r   r   request_asyncrq   r6   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#   r0   r<   r=   r6   r8   r$   s     r   r3   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)rG   z#<Twilio.Studio.V2.FlowRevisionList>r   r>   s    r   rY   zFlowRevisionList.__repr__  ru   r   )NN)r   r   r   r   r[   r2   r   intr	   r   r   r
   r   r   r   r   r   unsetr   rZ   rq   r~   r   r   r   r<   r3   r   rY   r]   r^   s   @r   rw   rw      s!   F Fc F$  $#';}; C=; 
&	'	;6  $#'A}A C=A 
+	,	A6  $#'
}
 C=
 
"	#	
8  $#'
}
 C=
 
"	#	
: *0*0,,(.	I#v+&I 3;'I f%	I
 
IF *0*0,,(.	I#v+&I 3;'I f%	I
 
IB
I3 
I+; 
I
Is 
I7G 
I
C 
$7 

 
)< 
5# 5r   rw   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   r<   rq   rw   r   r   r   <module>r      sg     L L L + 8 : 2 ' !^L+ ^LBFK/ FKR5t 5&m5| m5r   