
    pih                         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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	serialize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efd	Zdefd
ZddZddZej&                  fdededeeef   dd fdZej&                  fdededeeef   dd fdZdefdZ xZS )CustomOperatorInstancec                   $    e Zd ZdZdZdZdZdZdZy)#CustomOperatorInstance.Availabilityinternalbetapublicretiredzgeneral-availability
deprecatedN)	__name__
__module____qualname__INTERNALBETAPUBLICRETIREDGENERAL_AVAILABILITY
DEPRECATED     m/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/intelligence/v2/custom_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/   r0   r1   r   integerr)   r2   r3   iso8601_datetimer4   r5   r6   	_solution_context)selfr)   r*   r+   	__class__s       r'   r8   zCustomOperatorInstance.__init__2   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: CustomOperatorContext for this CustomOperatorInstance
        r+   r+   )r=   CustomOperatorContext_versionr<   r>   s    r'   _proxyzCustomOperatorInstance._proxyO   s9     == 1NN5)DM }}r&   c                 6    | j                   j                         S )q
        Deletes the CustomOperatorInstance


        :returns: True if delete succeeds, False otherwise
        )rF   deleterE   s    r'   rI   zCustomOperatorInstance.delete^   s     {{!!##r&   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the CustomOperatorInstance


        :returns: True if delete succeeds, False otherwise
        N)rF   delete_asyncrE   s    r'   rL   z#CustomOperatorInstance.delete_asyncg   s!      [[--////   '%'c                 6    | j                   j                         S )i
        Fetch the CustomOperatorInstance


        :returns: The fetched CustomOperatorInstance
        )rF   fetchrE   s    r'   rP   zCustomOperatorInstance.fetchp   s     {{  ""r&   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine to fetch the CustomOperatorInstance


        :returns: The fetched CustomOperatorInstance
        N)rF   fetch_asyncrE   s    r'   rS   z"CustomOperatorInstance.fetch_asyncy   s!      [[,,....rM   r.   r3   if_matchc                 >    | j                   j                  |||      S )a  
        Update the CustomOperatorInstance

        :param friendly_name: A human-readable name of this resource, up to 64 characters.
        :param config: Operator configuration, following the schema defined by the Operator Type.
        :param if_match: The If-Match HTTP request header

        :returns: The updated CustomOperatorInstance
        r.   r3   rT   )rF   updater>   r.   r3   rT   s       r'   rX   zCustomOperatorInstance.update   s)     {{!!' " 
 	
r&   c                 Z   K   | j                   j                  |||       d{   S 7 w){  
        Asynchronous coroutine to update the CustomOperatorInstance

        :param friendly_name: A human-readable name of this resource, up to 64 characters.
        :param config: Operator configuration, following the schema defined by the Operator Type.
        :param if_match: The If-Match HTTP request header

        :returns: The updated CustomOperatorInstance
        rW   N)rF   update_asyncrY   s       r'   r\   z#CustomOperatorInstance.update_async   s7      [[--' . 
 
 	
 
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>z2CustomOperatorInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z2<Twilio.Intelligence.V2.CustomOperatorInstance {}>joinr<   itemsrc   r>   contexts     r'   __repr__zCustomOperatorInstance.__repr__   s6     ((SDNN<P<P<RSSCJJ7SSr&   )N)r@   rC   )r@   r   )r   r   r   objectr(   r   r   strr   r   r8   propertyrF   boolrI   rL   rP   rS   r   unsetr   rX   r\   rp   __classcell__r?   s   @r'   r   r      s   "v "  OS>>)-c3h>>Fsm>:  $ $0D 0#/ (.||	

 
 V$	

 
"
2 (.||	

 
 V$	

 
"
*T# Tr&   r   c            	            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
de	fdZej                  fd	ed
edeeef   de	fdZej                  fd	ed
edeeef   de	fdZdefdZ xZS )rC   r)   r+   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the CustomOperatorContext

        :param version: Version that contains the resource
        :param sid: A 34 character string that uniquely identifies this Custom Operator.
        r+   z/Operators/Custom/{sid}Nr%   )r7   r8   r<   rc   _uri)r>   r)   r+   r?   s      r'   r8   zCustomOperatorContext.__init__   s@     	! 3
 5-44Ft~~F	r&   r@   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rH   DELETEmethoduriheaders)r   ofrD   rI   rz   r>   r   s     r'   rI   zCustomOperatorContext.delete   s1     ))B-}}##8G#TTr&   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rK   r|   r}   N)r   r   rD   rL   rz   r   s     r'   rL   z"CustomOperatorContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )rO   application/jsonAcceptGETr}   r+   rB   )r   r   rD   rP   rz   r   r<   r>   r   r*   s      r'   rP   zCustomOperatorContext.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)rR   r   r   r   r}   Nr+   rB   )r   r   rD   rS   rz   r   r<   r   s      r'   rS   z!CustomOperatorContext.fetch_async   sr      ))B-.11dii 2 
 
 &MMu%
 	
	
s   AA4A2	*A4r.   r3   rT   c                    t        j                  |t        j                  |      d      }t        j                  i       }|t         j                  u st        |t              r|r||d<   d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d	   
      S )rV   FriendlyNameConfigIf-Match!application/x-www-form-urlencodedContent-Typer   r   POSTr~   r   datar   r+   rB   )r   r   r   rq   ru   
isinstancerr   rD   rX   rz   r   r<   r>   r.   r3   rT   r   r   r*   s          r'   rX   zCustomOperatorContext.update  s      yy -#**62
 ))B- $Hc)B8"*GJ"E.--&&tyytW ' 
 &dmmW$..QVBWXXr&   c                   K   t        j                  |t        j                  |      d      }t        j                  i       }|t         j                  u st        |t              r|r||d<   d|d<   d|d<   | j                  j                  d| j                  ||       d	{   }t        | j                  || j                  d
         S 7 )w)r[   r   r   r   r   r   r   r   r   Nr+   rB   )r   r   r   rq   ru   r   rr   rD   r\   rz   r   r<   r   s          r'   r\   z"CustomOperatorContext.update_async2  s       yy -#**62
 ))B- $Hc)B8"*GJ"E.22tyytW 3 
 
 &dmmW$..QVBWXX	
s   B C"C#*Cc                     dj                  d | j                  j                         D              }dj                  |      S )r^   r_   c              3   F   K   | ]  \  }}d j                  ||        ywra   rb   rd   s      r'   rh   z1CustomOperatorContext.__repr__.<locals>.<genexpr>_  ri   rj   z1<Twilio.Intelligence.V2.CustomOperatorContext {}>rk   rn   s     r'   rp   zCustomOperatorContext.__repr__Y  s6     ((SDNN<P<P<RSSBII'RRr&   )r   r   r   r   rr   r8   rt   rI   rL   r   rP   rS   r   ru   rq   r   rX   r\   rp   rv   rw   s   @r'   rC   rC      s    G Gc G
U 
U
D 

- 
(
#9 
4 (.||	%Y%Y %Y V$	%Y
 
 %YV (.||	%Y%Y %Y V$	%Y
 
 %YNS# Sr&   rC   c                   2    e Zd Zdeeef   defdZdefdZy)CustomOperatorPager*   r@   c                 .    t        | j                  |      S )zt
        Build an instance of CustomOperatorInstance

        :param payload: Payload response from the API
        )r   rD   )r>   r*   s     r'   get_instancezCustomOperatorPage.get_instancee  s     &dmmW==r&   c                      y)r^   z+<Twilio.Intelligence.V2.CustomOperatorPage>r%   rE   s    r'   rp   zCustomOperatorPage.__repr__m       =r&   N)	r   r   r   r   rr   r   r   r   rp   r%   r&   r'   r   r   c  s*    >DcN >7M >=# =r&   r   c                       e Zd Zdef fdZdedededefdZdededed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                  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 )CustomOperatorListr)   c                 2    t         |   |       d| _        y)zp
        Initialize the CustomOperatorList

        :param version: Version that contains the resource

        z/Operators/CustomN)r7   r8   rz   )r>   r)   r?   s     r'   r8   zCustomOperatorList.__init__x  s     	!'	r&   r.   r1   r3   r@   c                    t        j                  ||t        j                  |      d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  |      S )a  
        Create the CustomOperatorInstance

        :param friendly_name: A human readable description of the new Operator, up to 64 characters.
        :param operator_type: Operator Type for this Operator. References an existing Operator Type resource.
        :param config: Operator configuration, following the schema defined by the Operator Type.

        :returns: The created CustomOperatorInstance
        r   OperatorTyper   r   r   r   r   r   r   )r   r   r   rq   rD   createrz   r   r>   r.   r1   r3   r   r   r*   s          r'   r   zCustomOperatorList.create  s     yy - -#**62
 ))^-PQR"E.--&&tyytW ' 
 &dmmW==r&   c                 6  K   t        j                  ||t        j                  |      d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	a  
        Asynchronously create the CustomOperatorInstance

        :param friendly_name: A human readable description of the new Operator, up to 64 characters.
        :param operator_type: Operator Type for this Operator. References an existing Operator Type resource.
        :param config: Operator configuration, following the schema defined by the Operator Type.

        :returns: The created CustomOperatorInstance
        r   r   r   r   r   r   r   N)r   r   r   rq   rD   create_asyncrz   r   r   s          r'   r   zCustomOperatorList.create_async  s      yy - -#**62
 ))^-PQR"E.22tyytW 3 
 
 &dmmW==	
s   A:B<B=BNr2   r   language_codelimit	page_sizec                     | j                   j                  ||      }| j                  |||d         }| j                   j                  ||d         S )a  
        Streams CustomOperatorInstance 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;CustomOperatorInstance.Availability&quot; availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Custom 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   r2   r   r   r   )rD   read_limitspagestreamr>   r2   r   r   r   limitsr   s          r'   r   zCustomOperatorList.stream  sX    4 **5)<yy%'[)  
 }}##D&/::r&   c                    K   | j                   j                  ||      }| j                  |||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams CustomOperatorInstance 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;CustomOperatorInstance.Availability&quot; availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Custom 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   )rD   r   
page_asyncstream_asyncr   s          r'   r   zCustomOperatorList.stream_async  sf     4 **5)<__%'[) % 
 
 }}))$w@@
s   7AA$Ac                 >    t        | j                  ||||            S )a"  
        Lists CustomOperatorInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

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

        :param &quot;CustomOperatorInstance.Availability&quot; availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param str language_code: Returns Custom 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>   r2   r   r   r   records         r'   
list_asynczCustomOperatorList.list_async+  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 )an  
        Retrieve a single page of CustomOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Custom 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 CustomOperatorInstance
        r(   LanguageCode	PageTokenr   PageSizer   r   r   r   r   r~   r   paramsr   )r   r   rD   r   rz   r   	r>   r2   r   r   r   r   r   r   responses	            r'   r   zCustomOperatorList.pageN  s    , yy , -'#%
 ))^-PQR.==%%diig & 
 "$--::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 CustomOperatorInstance records from the API.
        Request is executed immediately

        :param availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.
        :param language_code: Returns Custom 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 CustomOperatorInstance
        r   r   r   r   r   r   r   N)r   r   rD   r   rz   r   r   s	            r'   r   zCustomOperatorList.page_asyncw  s     , yy , -'#%
 ))^-PQR.11diig 2 
 
 "$--::
s   A$B&B'B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )a  
        Retrieve a specific page of CustomOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CustomOperatorInstance
        r   )rD   domaintwiliorequestr   r>   r   r   s      r'   get_pagezCustomOperatorList.get_page  s7     ==''..66ujI!$--::r&   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)a  
        Asynchronously retrieve a specific page of CustomOperatorInstance records from the API.
        Request is executed immediately

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

        :returns: Page of CustomOperatorInstance
        r   N)rD   r   r   request_asyncr   r   s      r'   get_page_asyncz!CustomOperatorList.get_page_async  sD      --44BB5*UU!$--:: Vs   4AAAr+   c                 0    t        | j                  |      S z
        Constructs a CustomOperatorContext

        :param sid: A 34 character string that uniquely identifies this Custom Operator.
        rB   rC   rD   r>   r+   s     r'   r9   zCustomOperatorList.get       %T]]<<r&   c                 0    t        | j                  |      S r   r   r   s     r'   __call__zCustomOperatorList.__call__  r   r&   c                      y)r^   z+<Twilio.Intelligence.V2.CustomOperatorList>r%   rE   s    r'   rp   zCustomOperatorList.__repr__  r   r&   ) r   r   r   r   r8   rr   rq   r   r   r   r   ru   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   r   rC   r9   r   rp   rv   rw   s   @r'   r   r   v  s   	( 	(> >14>>D>	>@> >14>>D>	>H LL,2LL##'!;169
!;
 S&[)!; }!; C=!; 
(	)!;N LL,2LL##'!A169
!A
 S&[)!A }!A C=!A 
-	.!AN LL,2LL##' 
169
 

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

 S&[)!
 }!
 C=!
 
$	%!
N LL,2LL)/*0,,(.';169
';
 S&[)'; #v+&'; 3;''; f%'; 
';Z LL,2LL)/*0,,(.';169
';
 S&[)'; #v+&'; 3;''; f%'; 
';R
;3 
;+= 
;
;s 
;7I 
;=s =4 ==C =$9 ==# =r&   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rC   r   r   r%   r&   r'   <module>r      sj     L L L 6 6 8 : 2 ' !ZT- ZTzjSO jSZ= =&X= X=r&   