
    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 - Serverless
    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dZ	 ddedeeef   dede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$                  ej$                  fdeeef   deeef   dd fdZej$                  ej$                  fdeeef   deeef   dd fdZdefdZ xZS )VariableInstancea  
    :ivar sid: The unique string that we created to identify the Variable resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Variable resource.
    :ivar service_sid: The SID of the Service that the Variable resource is associated with.
    :ivar environment_sid: The SID of the Environment in which the Variable exists.
    :ivar key: A string by which the Variable resource can be referenced.
    :ivar value: A string that contains the actual value of the Variable.
    :ivar date_created: The date and time in GMT when the Variable resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the Variable resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar url: The absolute URL of the Variable resource.
    versionpayloadservice_sidenvironment_sidsidc                 <   t         |   |       |j                  d      | _        |j                  d      | _        |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_sidr   r   keyvaluedate_createddate_updatedurlr   r   r   )super__init__getr   r   r   r   r   r   r   iso8601_datetimer   r   r   	_solution_context)selfr   r   r   r   r   	__class__s         x/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/serverless/v1/service/environment/variable.pyr"   zVariableInstance.__init__&   s     	!")++e"4*1++m*D*1++m*D.5kk:K.L")++e"4$+KK$8
0;0L0LKK'1
 1<0L0LKK'1
 #*++e"4 '.?$((

 48    returnc                     | j                   Et        | j                  | j                  d   | 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: VariableContext for this VariableInstance
        r   r   r   r    )r&   VariableContext_versionr%   r'   s    r)   _proxyzVariableInstance._proxyE   sR     == + NN=9 $/@ ANN5)	DM }}r*   c                 6    | j                   j                         S )k
        Deletes the VariableInstance


        :returns: True if delete succeeds, False otherwise
        )r0   deleter/   s    r)   r3   zVariableInstance.deleteV   s     {{!!##r*   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the VariableInstance


        :returns: True if delete succeeds, False otherwise
        N)r0   delete_asyncr/   s    r)   r6   zVariableInstance.delete_async_   s!      [[--////   '%'c                 6    | j                   j                         S )]
        Fetch the VariableInstance


        :returns: The fetched VariableInstance
        )r0   fetchr/   s    r)   r:   zVariableInstance.fetchh   s     {{  ""r*   c                 R   K   | j                   j                          d{   S 7 w)w
        Asynchronous coroutine to fetch the VariableInstance


        :returns: The fetched VariableInstance
        N)r0   fetch_asyncr/   s    r)   r=   zVariableInstance.fetch_asyncq   s!      [[,,....r7   r   r   c                 <    | j                   j                  ||      S )M  
        Update the VariableInstance

        :param key: A string by which the Variable resource can be referenced. It can be a maximum of 128 characters.
        :param value: A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size.

        :returns: The updated VariableInstance
        r   r   )r0   updater'   r   r   s      r)   rA   zVariableInstance.updatez   s&     {{!! " 
 	
r*   c                 X   K   | j                   j                  ||       d{   S 7 w)g  
        Asynchronous coroutine to update the VariableInstance

        :param key: A string by which the Variable resource can be referenced. It can be a maximum of 128 characters.
        :param value: A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size.

        :returns: The updated VariableInstance
        r@   N)r0   update_asyncrB   s      r)   rE   zVariableInstance.update_async   s4      [[-- . 
 
 	
 
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>z,VariableInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z*<Twilio.Serverless.V1.VariableInstance {}>joinr%   itemsrL   r'   contexts     r)   __repr__zVariableInstance.__repr__   s6     ((SDNN<P<P<RSS;BB7KKr*   )N)r+   r-   )r+   r   )__name__
__module____qualname____doc__r   r   strr   r   r"   propertyr0   boolr3   r6   r:   r=   r   unsetr   objectrA   rE   rY   __classcell__r(   s   @r)   r   r      s   
$ "88 c3h8 	8
 8 c]8>   $ $0D 0#/ #),,$*LL
3;
 S&[!
 
	
( #),,$*LL
3;
 S&[!
 
	
$L# Lr*   r   c                       e Zd Zde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ej                  ej                  fdeeef   deeef   de	fdZej                  ej                  fdeeef   deeef   de	fdZdefdZ xZS )r-   r   r   r   r   c                 |    t         |   |       |||d| _         dj                  di | j                  | _        y)ag  
        Initialize the VariableContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the Service to update the Variable resource under.
        :param environment_sid: The SID of the Environment with the Variable resource to update.
        :param sid: The SID of the Variable resource to update.
        r    zF/Services/{service_sid}/Environments/{environment_sid}/Variables/{sid}N r!   r"   r%   rL   _uri)r'   r   r   r   r   r(   s        r)   r"   zVariableContext.__init__   sJ     	! '.

 d\cc 
nn
	r*   r+   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r2   DELETEmethoduriheaders)r   ofr.   r3   ri   r'   ro   s     r)   r3   zVariableContext.delete   s1     ))B-}}##8G#TTr*   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)r5   rk   rl   N)r   rp   r.   r6   ri   rq   s     r)   r6   zVariableContext.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   | j                  d   | j                  d         S )	r9   application/jsonAcceptGETrl   r   r   r   r    )r   rp   r.   r:   ri   r   r%   r'   ro   r   s      r)   r:   zVariableContext.fetch   sv     ))B-.--%%U		7%SMM}5 NN+<=u%
 	
r*   c                 $  K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d   | j                  d   	      S 7 Ew)
r<   rt   ru   rv   rl   Nr   r   r   r    )r   rp   r.   r=   ri   r   r%   rw   s      r)   r=   zVariableContext.fetch_async   s      ))B-.11dii 2 
 
  MM}5 NN+<=u%
 	
	
s   ABB	ABr   r   c                 D   t        j                  ||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d	   | j                  d
         S )r?   KeyValue!application/x-www-form-urlencodedContent-Typert   ru   POSTrm   rn   dataro   r   r   r   r    )r   rp   r.   rA   ri   r   r%   r'   r   r   r   ro   r   s         r)   rA   zVariableContext.update	  s     yy
 ))B-"E.--&&tyytW ' 
  MM}5 NN+<=u%
 	
r*   c                 `  K   t        j                  ||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   | j                  d
   | j                  d         S 7 Ew)rD   rz   r}   r~   rt   ru   r   r   Nr   r   r   r    )r   rp   r.   rE   ri   r   r%   r   s         r)   rE   zVariableContext.update_async/  s      yy
 ))B-"E.22tyytW 3 
 
  MM}5 NN+<=u%
 	
	
s   A$B.&B,'AB.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+VariableContext.__repr__.<locals>.<genexpr>[  rR   rS   z)<Twilio.Serverless.V1.VariableContext {}>rT   rW   s     r)   rY   zVariableContext.__repr__U  s6     ((SDNN<P<P<RSS:AA'JJr*   )rZ   r[   r\   r   r^   r"   r`   r3   r6   r   r:   r=   r   ra   r   rb   rA   rE   rY   rc   rd   s   @r)   r-   r-      s    

-0
CF
MP
.
U 
U
D 

' 
,
#3 
4 #),,$*LL$
3;$
 S&[!$
 
	$
P #),,$*LL$
3;$
 S&[!$
 
	$
L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)VariablePager   r+   c                 h    t        | j                  || j                  d   | j                  d         S )zn
        Build an instance of VariableInstance

        :param payload: Payload response from the API
        r   r   r   r   )r   r.   r%   )r'   r   s     r)   get_instancezVariablePage.get_instancea  s4      MM}5 NN+<=	
 	
r*   c                      y)rG   z#<Twilio.Serverless.V1.VariablePage>rg   r/   s    r)   rY   zVariablePage.__repr__n       5r*   N)	rZ   r[   r\   r   r^   r   r   r   rY   rg   r*   r)   r   r   _  s*    
DcN 
7G 
5# 5r*   r   c            	       D    e Zd Zdededef fdZdededefdZded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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 )VariableListr   r   r   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)a"  
        Initialize the VariableList

        :param version: Version that contains the resource
        :param service_sid: The SID of the Service to read the Variable resources from.
        :param environment_sid: The SID of the Environment with the Variable resources to read.

        r   z@/Services/{service_sid}/Environments/{environment_sid}/VariablesNrg   rh   )r'   r   r   r   r(   s       r)   r"   zVariableList.__init__y  sJ     	! '.

 VNUU .. 		r*   r   r   r+   c                 ,   t        j                  ||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d	   
      S )aM  
        Create the VariableInstance

        :param key: A string by which the Variable resource can be referenced. It can be a maximum of 128 characters.
        :param value: A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size.

        :returns: The created VariableInstance
        rz   r~   r}   rt   ru   r   r   r   r   r   )r   rp   r.   createri   r   r%   r   s         r)   r   zVariableList.create  s     yy
 ))^-PQR"E.--&&tyytW ' 
  MM}5 NN+<=	
 	
r*   c                 H  K   t        j                  ||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   | j                  d
         S 7 7w)a\  
        Asynchronously create the VariableInstance

        :param key: A string by which the Variable resource can be referenced. It can be a maximum of 128 characters.
        :param value: A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size.

        :returns: The created VariableInstance
        rz   r~   r}   rt   ru   r   r   Nr   r   r   )r   rp   r.   create_asyncri   r   r%   r   s         r)   r   zVariableList.create_async  s      yy
 ))^-PQR"E.22tyytW 3 
 
  MM}5 NN+<=	
 	
	
s   A&B"(B )8B"limit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )a^  
        Streams VariableInstance 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r'   r   r   limitsr   s        r)   r   zVariableList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r*   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)am  
        Asynchronously streams VariableInstance 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VariableList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists VariableInstance 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   )r'   r   r   s      r)   r   zVariableList.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 VariableInstance 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   )r'   r   r   records       r)   
list_asynczVariableList.list_async  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 )au  
        Retrieve a single page of VariableInstance 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 VariableInstance
        	PageTokenr   PageSizer~   r}   rt   ru   rv   rm   rn   paramsro   )r   rp   r.   r   ri   r   r%   r'   r   r   r   r   ro   responses          r)   r   zVariableList.page8  s      yy'#%
 ))^-PQR.==%%diig & 
 DMM8T^^DDr*   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 VariableInstance 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 VariableInstance
        r   r~   r}   rt   ru   rv   r   N)r   rp   r.   r   ri   r   r%   r   s          r)   r   zVariableList.page_asyncY  s       yy'#%
 ))^-PQR.11diig 2 
 
 DMM8T^^DD
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of VariableInstance records from the API.
        Request is executed immediately

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

        :returns: Page of VariableInstance
        rv   )r.   domaintwiliorequestr   r%   r'   r   r   s      r)   get_pagezVariableList.get_pagez  s=     ==''..66ujIDMM8T^^DDr*   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a  
        Asynchronously retrieve a specific page of VariableInstance records from the API.
        Request is executed immediately

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

        :returns: Page of VariableInstance
        rv   N)r.   r   r   request_asyncr   r%   r   s      r)   get_page_asynczVariableList.get_page_async  sJ      --44BB5*UUDMM8T^^DD Vs   4AA&Ar   c                 h    t        | j                  | j                  d   | j                  d   |      S zo
        Constructs a VariableContext

        :param sid: The SID of the Variable resource to update.
        r   r   r    r-   r.   r%   r'   r   s     r)   r#   zVariableList.get  4     MM}5 NN+<=	
 	
r*   c                 h    t        | j                  | j                  d   | j                  d   |      S r   r   r   s     r)   __call__zVariableList.__call__  r   r*   c                      y)rG   z#<Twilio.Serverless.V1.VariableList>rg   r/   s    r)   rY   zVariableList.__repr__  r   r*   )NN) rZ   r[   r\   r   r^   r"   r   r   r   r   intr	   r   r
   r   r   r   r   r   ra   r   rb   r   r   r   r   r   r-   r#   r   rY   rc   rd   s   @r)   r   r   w  sY   
 
c 
C 
,
# 
c 
.> 
B
c 
# 
:J 
F  $#';}; C=; 
"	#	;6  $#'A}A C=A 
'	(	A6  $#'
}
 C=
 
		
8  $#'
}
 C=
 
		
: *0*0,,(.	E#v+&E 3;'E f%	E
 
EF *0*0,,(.	E#v+&E 3;'E f%	E
 
EB
E3 
E< 
E
Es 
E| 
E
s 
 

C 
O 
5# 5r*   r   N)r]   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-   r   r   rg   r*   r)   <module>r      sg     L L L + 8 : 2 ' !LL' LL^tKo tKn54 50{5< {5r*   