
    piL                         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 - Intelligence
    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	e   f fdZ
edd       Zdd	Zdd
ZdefdZ xZS )PrebuiltOperatorInstancec                        e Zd ZdZdZdZdZdZy)%PrebuiltOperatorInstance.Availabilityinternalbetapublicretiredzgeneral-availabilityN)__name__
__module____qualname__INTERNALBETAPUBLICRETIREDGENERAL_AVAILABILITY     o/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/intelligence/v2/prebuilt_operator.pyAvailabilityr      s    5r#   r%   versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        |j                  d      | _        |j                  d	      | _        t        j                  |j                  d
            | _        t        j                  |j                  d            | _        |j                  d      | _        d|xs | j                  i| _        d | _        y )Naccount_sidr(   friendly_namedescriptionauthoroperator_typer&   availabilityconfigdate_createddate_updatedurl)super__init__getr*   r(   r+   r,   r-   r.   r   integerr&   r/   r0   iso8601_datetimer1   r2   r3   	_solution_context)selfr&   r'   r(   	__class__s       r$   r5   z!PrebuiltOperatorInstance.__init__1   s+    	!*1++m*D")++e"4,3KK,H*1++m*D%,[[%:,3KK,H&1&9&9'++i:P&QKK' 	 4;;;x3H0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 3?$((
 <@r#   returnc                     | j                   )t        | j                  | 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: PrebuiltOperatorContext for this PrebuiltOperatorInstance
        r(   r(   )r:   PrebuiltOperatorContext_versionr9   r;   s    r$   _proxyzPrebuiltOperatorInstance._proxyN   s9     == 3NN5)DM }}r#   c                 6    | j                   j                         S )m
        Fetch the PrebuiltOperatorInstance


        :returns: The fetched PrebuiltOperatorInstance
        )rC   fetchrB   s    r$   rF   zPrebuiltOperatorInstance.fetch]   s     {{  ""r#   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine to fetch the PrebuiltOperatorInstance


        :returns: The fetched PrebuiltOperatorInstance
        N)rC   fetch_asyncrB   s    r$   rI   z$PrebuiltOperatorInstance.fetch_asyncf   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>z4PrebuiltOperatorInstance.__repr__.<locals>.<genexpr>u        SDAq7>>!Q/S   !z4<Twilio.Intelligence.V2.PrebuiltOperatorInstance {}>joinr9   itemsrP   r;   contexts     r$   __repr__z!PrebuiltOperatorInstance.__repr__o   s6     ((SDNN<P<P<RSSELLWUUr#   )N)r=   r@   )r=   r   )r   r   r   objectr%   r   r   strr   r   r5   propertyrC   rF   rI   r]   __classcell__r<   s   @r$   r   r      st    6v 6  OS@@)-c3h@>Fsm@:  #/V# Vr#   r   c                   L     e Zd Z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(   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the PrebuiltOperatorContext

        :param version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this Pre-built Operator.
        r(   z/Operators/PreBuilt/{sid}Nr"   )r4   r5   r9   rP   _uri)r;   r&   r(   r<   s      r$   r5   z PrebuiltOperatorContext.__init__{   s@     	! 3
 7/66HH	r#   r=   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )rE   application/jsonAcceptGETmethoduriheadersr(   r?   )r   ofrA   rF   re   r   r9   r;   rm   r'   s      r$   rF   zPrebuiltOperatorContext.fetch   s]     ))B-.--%%U		7%S'MMu%
 	
r#   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)rH   rg   rh   ri   rj   Nr(   r?   )r   rn   rA   rI   re   r   r9   ro   s      r$   rI   z#PrebuiltOperatorContext.fetch_async   sr      ))B-.11dii 2 
 
 (MMu%
 	
	
s   AA4A2	*A4c                     dj                  d | j                  j                         D              }dj                  |      S )rK   rL   c              3   F   K   | ]  \  }}d j                  ||        ywrN   rO   rQ   s      r$   rU   z3PrebuiltOperatorContext.__repr__.<locals>.<genexpr>   rV   rW   z3<Twilio.Intelligence.V2.PrebuiltOperatorContext {}>rX   r[   s     r$   r]   z PrebuiltOperatorContext.__repr__   s6     ((SDNN<P<P<RSSDKKGTTr#   )r   r   r   r   r_   r5   r   rF   rI   r]   ra   rb   s   @r$   r@   r@   y   sA    I Ic I
/ 
(
#; 
,U# Ur#   r@   c                   2    e Zd Zdeeef   defdZdefdZy)PrebuiltOperatorPager'   r=   c                 .    t        | j                  |      S )zv
        Build an instance of PrebuiltOperatorInstance

        :param payload: Payload response from the API
        )r   rA   )r;   r'   s     r$   get_instancez!PrebuiltOperatorPage.get_instance   s     (w??r#   c                      y)rK   z-<Twilio.Intelligence.V2.PrebuiltOperatorPage>r"   rB   s    r$   r]   zPrebuiltOperatorPage.__repr__        ?r#   N)	r   r   r   r   r_   r   r   rv   r]   r"   r#   r$   rt   rt      s-    @DcN @7O @?# ?r#   rt   c                       e Zd Zdef fdZej                  ej                  ddfdedef   dee	ef   de
e   de
e   d	ee   f
d
Zej                  ej                  ddfdedef   dee	ef   de
e   de
e   d	ee   f
dZej                  ej                  ddfdedef   dee	ef   de
e   de
e   d	ee   f
dZej                  ej                  ddfdedef   dee	ef   de
e   de
e   d	ee   f
dZej                  ej                  ej                  ej                  ej                  fdedef   dee	e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                  ej                  ej                  fdedef   dee	e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 )PrebuiltOperatorListr&   c                 2    t         |   |       d| _        y)zr
        Initialize the PrebuiltOperatorList

        :param version: Version that contains the resource

        z/Operators/PreBuiltN)r4   r5   re   )r;   r&   r<   s     r$   r5   zPrebuiltOperatorList.__init__   s     	!)	r#   Nr/   r   language_codelimit	page_sizer=   c                     | j                   j                  ||      }| j                  |||d         }| j                   j                  ||d         S )a  
        Streams PrebuiltOperatorInstance 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 &quot;PrebuiltOperatorInstance.Availability&quot; availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Pre-built Operators that support the provided language code.
        :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~   r}   )rA   read_limitspagestreamr;   r/   r|   r}   r~   limitsr   s          r$   r   zPrebuiltOperatorList.stream   sX    4 **5)<yy%'[)  
 }}##D&/::r#   c                    K   | j                   j                  ||      }| j                  |||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams PrebuiltOperatorInstance 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 &quot;PrebuiltOperatorInstance.Availability&quot; availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Pre-built Operators that support the provided language code.
        :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}   )rA   r   
page_asyncstream_asyncr   s          r$   r   z!PrebuiltOperatorList.stream_async  sf     4 **5)<__%'[) % 
 
 }}))$w@@
s   7AA$Ac                 >    t        | j                  ||||            S )a,  
        Lists PrebuiltOperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param &quot;PrebuiltOperatorInstance.Availability&quot; availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Pre-built Operators that support the provided language code.
        :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|   r}   r~   )listr   )r;   r/   r|   r}   r~   s        r$   r   zPrebuiltOperatorList.list$  s.    2 KK)+#	  
 	
r#   c                 ~   K   | j                  ||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a;  
        Asynchronously lists PrebuiltOperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param &quot;PrebuiltOperatorInstance.Availability&quot; availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Pre-built Operators that support the provided language code.
        :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   )r;   r/   r|   r}   r~   records         r$   
list_asynczPrebuiltOperatorList.list_asyncF  sZ     6 '+&7&7)+#	 '8 ' !
 
 !
 
 	
 
s0   =0=842
48=48=
page_tokenpage_numberc                     t        j                  |||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  |      S )ax  
        Retrieve a single page of PrebuiltOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Pre-built Operators that support the provided language code.
        :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 PrebuiltOperatorInstance
        r%   LanguageCode	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrg   rh   ri   rk   rl   paramsrm   )r   rn   rA   r   re   rt   	r;   r/   r|   r   r   r~   datarm   responses	            r$   r   zPrebuiltOperatorList.pagei  s    , yy , -'#%
 ))^-PQR.==%%diig & 
 $DMM8<<r#   c                 
  K   t        j                  |||||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	a  
        Asynchronously retrieve a single page of PrebuiltOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Pre-built Operators that support the provided language code.
        :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 PrebuiltOperatorInstance
        r   r   r   rg   rh   ri   r   N)r   rn   rA   r   re   rt   r   s	            r$   r   zPrebuiltOperatorList.page_async  s     , yy , -'#%
 ))^-PQR.11diig 2 
 
 $DMM8<<
s   A$B&B'B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )a  
        Retrieve a specific page of PrebuiltOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PrebuiltOperatorInstance
        ri   )rA   domaintwiliorequestrt   r;   r   r   s      r$   get_pagezPrebuiltOperatorList.get_page  s7     ==''..66ujI#DMM8<<r#   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)a  
        Asynchronously retrieve a specific page of PrebuiltOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of PrebuiltOperatorInstance
        ri   N)rA   r   r   request_asyncrt   r   s      r$   get_page_asyncz#PrebuiltOperatorList.get_page_async  sD      --44BB5*UU#DMM8<< Vs   4AAAr(   c                 0    t        | j                  |      S z
        Constructs a PrebuiltOperatorContext

        :param sid: A 34 character string that uniquely identifies this Pre-built Operator.
        r?   r@   rA   r;   r(   s     r$   r6   zPrebuiltOperatorList.get       't}}#>>r#   c                 0    t        | j                  |      S r   r   r   s     r$   __call__zPrebuiltOperatorList.__call__  r   r#   c                      y)rK   z-<Twilio.Intelligence.V2.PrebuiltOperatorList>r"   rB   s    r$   r]   zPrebuiltOperatorList.__repr__  rx   r#   )r   r   r   r   r5   r   unsetr   r^   r_   r   intr	   r   r   r
   r   r   r   r   rt   r   r   r   r   r@   r6   r   r]   ra   rb   s   @r$   rz   rz      s]   	* 	* LL,2LL##'!;3V;
!;
 S&[)!; }!; C=!; 
*	+!;N LL,2LL##'!A3V;
!A
 S&[)!A }!A C=!A 
/	0!AN LL,2LL##' 
3V;
 

 S&[) 
 } 
 C= 
 
&	' 
L LL,2LL##'!
3V;
!

 S&[)!
 }!
 C=!
 
&	'!
N LL,2LL)/*0,,(.'=3V;
'=
 S&[)'= #v+&'= 3;''= f%'= 
'=Z LL,2LL)/*0,,(.'=3V;
'=
 S&[)'= #v+&'= 3;''= f%'= 
'=R
=3 
=+? 
=
=s 
=7K 
=?s ?6 ??C ?$; ??# ?r#   rz   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@   rt   rz   r"   r#   r$   <module>r      sg     L L L + 8 : 2 ' !]V/ ]V@BUo BUJ?4 ?&X?< X?r#   