
    pipI                         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 - Api
    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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eef   dd fdZej$                  fdeeef   dd fdZdefdZ xZS )KeyInstancea  
    :ivar sid: The unique string that that we created to identify the Key resource.
    :ivar friendly_name: The string that you assigned to describe the resource.
    :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
    versionpayloadaccount_sidsidc                 ^   t         |   |       |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        ||xs | j                  d| _	        d | _
        y )Nr   friendly_namedate_createddate_updatedr   r   )super__init__getr   r   r   rfc2822_datetimer   r   	_solution_context)selfr   r   r   r   	__class__s        c/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/api/v2010/account/key.pyr   zKeyInstance.__init__!   s     	!")++e"4,3KK,H0;0L0LKK'1
 1<0L0LKK'1

 '?$((
 /3    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: KeyContext for this KeyInstance
        r   r   r   )r"   
KeyContext_versionr!   r#   s    r%   _proxyzKeyInstance._proxy9   sE     == & NN=9NN5)DM
 }}r&   c                 6    | j                   j                         S )f
        Deletes the KeyInstance


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


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


        :returns: The fetched KeyInstance
        )r,   fetchr+   s    r%   r6   zKeyInstance.fetch[   s     {{  ""r&   c                 R   K   | j                   j                          d{   S 7 w)m
        Asynchronous coroutine to fetch the KeyInstance


        :returns: The fetched KeyInstance
        N)r,   fetch_asyncr+   s    r%   r9   zKeyInstance.fetch_asyncd   s!      [[,,....r3   r   c                 :    | j                   j                  |      S )
        Update the KeyInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.

        :returns: The updated KeyInstance
        r   )r,   updater#   r   s     r%   r=   zKeyInstance.updatem   s#     {{!!' " 
 	
r&   c                 V   K   | j                   j                  |       d{   S 7 w)
        Asynchronous coroutine to update the KeyInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.

        :returns: The updated KeyInstance
        r<   N)r,   update_asyncr>   s     r%   rA   zKeyInstance.update_asyncy   s1      [[--' . 
 
 	
 
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'KeyInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z!<Twilio.Api.V2010.KeyInstance {}>joinr!   itemsrH   r#   contexts     r%   __repr__zKeyInstance.__repr__   s6     ((SDNN<P<P<RSS299'BBr&   )N)r'   r)   )r'   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr,   boolr/   r2   r6   r9   r   unsetr   objectr=   rA   rU   __classcell__r$   s   @r%   r   r      s     "33 c3h3 	3
 c]30  $ $0D 0#/ :@ 

E#v+$6 

- 

 39,,
"3;/
	
C# C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ej                  fd
eeef   de	fdZej                  fd
eeef   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)aW  
        Initialize the KeyContext

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to update.
        :param sid: The Twilio-provided string that uniquely identifies the Key resource to update.
        r   z'/Accounts/{account_sid}/Keys/{sid}.jsonN r   r   r!   rH   _uri)r#   r   r   r   r$   s       r%   r   zKeyContext.__init__   sB     	! '
 E=DDVt~~V	r&   r'   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r.   DELETEmethoduriheaders)r   ofr*   r/   re   r#   rk   s     r%   r/   zKeyContext.delete   s1     ))B-}}##8G#TTr&   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)r1   rg   rh   N)r   rl   r*   r2   re   rm   s     r%   r2   zKeyContext.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         S )r5   application/jsonAcceptGETrh   r   r   r   )r   rl   r*   r6   re   r   r!   r#   rk   r   s      r%   r6   zKeyContext.fetch   si     ))B-.--%%U		7%SMM}5u%	
 	
r&   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	r8   rp   rq   rr   rh   Nr   r   r   )r   rl   r*   r9   re   r   r!   rs   s      r%   r9   zKeyContext.fetch_async   s~      ))B-.11dii 2 
 
 MM}5u%	
 	
	
s   ABB 	8Br   c                 &   t        j                  d|i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d	   
      S )r;   FriendlyName!application/x-www-form-urlencodedContent-Typerp   rq   POSTri   rj   datark   r   r   r   )r   rl   r*   r=   re   r   r!   r#   r   r{   rk   r   s        r%   r=   zKeyContext.update   s     yy

 ))B-"E.--&&tyytW ' 
 MM}5u%	
 	
r&   c                 B  K   t        j                  d|i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   | j                  d
         S 7 7w)r@   rv   rw   rx   rp   rq   ry   rz   Nr   r   r   )r   rl   r*   rA   re   r   r!   r|   s        r%   rA   zKeyContext.update_async	  s      yy

 ))B-"E.22tyytW 3 
 
 MM}5u%	
 	
	
s   A#B%B&8Bc                     dj                  d | j                  j                         D              }dj                  |      S )rC   rD   c              3   F   K   | ]  \  }}d j                  ||        ywrF   rG   rI   s      r%   rM   z&KeyContext.__repr__.<locals>.<genexpr>0  rN   rO   z <Twilio.Api.V2010.KeyContext {}>rP   rS   s     r%   rU   zKeyContext.__repr__*  s6     ((SDNN<P<P<RSS188AAr&   )rV   rW   rX   r   rZ   r   r\   r/   r2   r   r6   r9   r   r]   r   r^   r=   rA   rU   r_   r`   s   @r%   r)   r)      s    W Wc W W"
U 
U
D 

{ 
*
; 
. :@ 
E#v+$6 
+ 
@ 39,,
"3;/
	
BB# Br&   r)   c                   2    e Zd Zdeeef   defdZdefdZy)KeyPager   r'   c                 L    t        | j                  || j                  d         S )zi
        Build an instance of KeyInstance

        :param payload: Payload response from the API
        r   )r   )r   r*   r!   )r#   r   s     r%   get_instancezKeyPage.get_instance6  s%     MM7}0M
 	
r&   c                      y)rC   z<Twilio.Api.V2010.KeyPage>rc   r+   s    r%   rU   zKeyPage.__repr__@       ,r&   N)	rV   rW   rX   r   rZ   r   r   r   rU   rc   r&   r%   r   r   4  s)    
DcN 
{ 
,# ,r&   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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 )KeyListr   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the KeyList

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to read.

        r   z!/Accounts/{account_sid}/Keys.jsonNrc   rd   )r#   r   r   r$   s      r%   r   zKeyList.__init__K  s@     	! ;
 ?7>>PP	r&   limit	page_sizer'   c                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )aY  
        Streams KeyInstance 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KeyList.stream[  sJ    ( **5)<yy6+#6y7}}##D&/::r&   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ah  
        Asynchronously streams KeyInstance 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KeyList.stream_asynct  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists KeyInstance 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KeyList.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 KeyInstance 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KeyList.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 )ak  
        Retrieve a single page of KeyInstance 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 KeyInstance
        	PageTokenr   PageSizerx   rw   rp   rq   rr   ri   rj   paramsrk   )r   rl   r*   r   re   r   r!   r#   r   r   r   r{   rk   responses          r%   r   zKeyList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 t}}h??r&   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	az  
        Asynchronously retrieve a single page of KeyInstance 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 KeyInstance
        r   rx   rw   rp   rq   rr   r   N)r   rl   r*   r   re   r   r!   r   s          r%   r   zKeyList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 t}}h??
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of KeyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of KeyInstance
        rr   )r*   domaintwiliorequestr   r!   r#   r   r   s      r%   get_pagezKeyList.get_page  s=     ==''..66ujIt}}h??r&   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)z
        Asynchronously retrieve a specific page of KeyInstance records from the API.
        Request is executed immediately

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

        :returns: Page of KeyInstance
        rr   N)r*   r   r   request_asyncr   r!   r   s      r%   get_page_asynczKeyList.get_page_async  sJ      --44BB5*UUt}}h?? Vs   4AA&Ar   c                 L    t        | j                  | j                  d   |      S z
        Constructs a KeyContext

        :param sid: The Twilio-provided string that uniquely identifies the Key resource to update.
        r   r   r)   r*   r!   r#   r   s     r%   r   zKeyList.get  %     MMt~~m'D#
 	
r&   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r%   __call__zKeyList.__call__&  r   r&   c                      y)rC   z<Twilio.Api.V2010.KeyList>rc   r+   s    r%   rU   zKeyList.__repr__0  r   r&   )NN)rV   rW   rX   r   rZ   r   r   intr	   r   r   r
   r   r   r   r   r   r]   r   r^   r   r   r   r   r   r)   r   r   rU   r_   r`   s   @r%   r   r   I  s   Q Qc Q$  $#';}; C=; 
+		;6  $#'A}A C=A 
{	#	A6  $#'
}
 C=
 
k		
8  $#'
}
 C=
 
k		
: *0*0,,(.	@#v+&@ 3;'@ f%	@
 
@F *0*0,,(.	@#v+&@ 3;'@ f%	@
 
@B
@3 
@7 
@
@s 
@w 
@
s 
z 

C 
J 
,# ,r&   r   N)rY   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   rc   r&   r%   <module>r      sg     L L L + 8 : 2 ' !uC" uCp`B `BF,d ,*m,l m,r&   