
    pi .                         d Z ddlmZ ddl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  G d	 d
e      Z G d de      Z G d de      Zy)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Iam
    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OptionalUnion)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Versionc                   6    e Zd Zd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$                  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 )ApiKeyInstancea/  
    :ivar sid: The unique string 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.
    :ivar policy: The \`Policy\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
    versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _        |j                  d      | _	        d|xs | j                  i| _
        d | _        y )Nr   friendly_namedate_createddate_updatedpolicy)super__init__getr   r   r   rfc2822_datetimer   r   r   	_solution_context)selfr   r   r   	__class__s       \/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/iam/v1/api_key.pyr   zApiKeyInstance.__init__!   s     	!")++e"4,3KK,H0;0L0LKK'1
 1<0L0LKK'1
 4;;;x3H 3?$((
 26    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: ApiKeyContext for this ApiKeyInstance
        r   r   )r   ApiKeyContext_versionr   r   s    r!   _proxyzApiKeyInstance._proxy5   s9     == )NN5)DM }}r"   c                 6    | j                   j                         S )i
        Deletes the ApiKeyInstance


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


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


        :returns: The fetched ApiKeyInstance
        )r)   fetchr(   s    r!   r3   zApiKeyInstance.fetchV   s     {{  ""r"   c                 R   K   | j                   j                          d{   S 7 w)s
        Asynchronous coroutine to fetch the ApiKeyInstance


        :returns: The fetched ApiKeyInstance
        N)r)   fetch_asyncr(   s    r!   r6   zApiKeyInstance.fetch_async_   s!      [[,,....r0   r   r   c                 <    | j                   j                  ||      S )>  
        Update the ApiKeyInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param policy: The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).

        :returns: The updated ApiKeyInstance
        r   r   )r)   updater   r   r   s      r!   r:   zApiKeyInstance.updateh   s&     {{!!' " 
 	
r"   c                 X   K   | j                   j                  ||       d{   S 7 w)X  
        Asynchronous coroutine to update the ApiKeyInstance

        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param policy: The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).

        :returns: The updated ApiKeyInstance
        r9   N)r)   update_asyncr;   s      r!   r>   zApiKeyInstance.update_asyncz   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*ApiKeyInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z!<Twilio.Iam.V1.ApiKeyInstance {}>joinr   itemsrE   r   contexts     r!   __repr__zApiKeyInstance.__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,   r/   r3   r6   r
   unsetr   objectr:   r>   rR   __classcell__r    s   @r!   r   r      s    OS66)-c3h6>Fsm6(  $ $0D 0#/ -3LL(.
S&[)
 ffn%
 
	
( -3LL(.
S&[)
 ffn%
 
	
$C# C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                  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   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the ApiKeyContext

        :param version: Version that contains the resource
        :param sid: The Twilio-provided string that uniquely identifies the Key resource to update.
        r   z/Keys/{sid}N )r   r   r   rE   _uri)r   r   r   r    s      r!   r   zApiKeyContext.__init__   s?     	! 3
 )M((:4>>:	r"   r#   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r+   DELETEmethoduriheaders)r
   ofr'   r,   ra   r   rg   s     r!   r,   zApiKeyContext.delete   s1     ))B-}}##8G#TTr"   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)r.   rc   rd   N)r
   rh   r'   r/   ra   ri   s     r!   r/   zApiKeyContext.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 )r2   application/jsonAcceptGETrd   r   r%   )r
   rh   r'   r3   ra   r   r   r   rg   r   s      r!   r3   zApiKeyContext.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)r5   rl   rm   rn   rd   Nr   r%   )r
   rh   r'   r6   ra   r   r   ro   s      r!   r6   zApiKeyContext.fetch_async   sr      ))B-.11dii 2 
 
 MMu%
 	
	
s   AA4A2	*A4r   r   c                 2   t        j                  |t        j                  |      d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   	      S )
r8   FriendlyNamePolicy!application/x-www-form-urlencodedContent-Typerl   rm   POSTre   rf   datarg   r   r%   )	r
   rh   r	   r[   r'   r:   ra   r   r   r   r   r   ry   rg   r   s         r!   r:   zApiKeyContext.update   s     yy -#**62
 ))B-"E.--&&tyytW ' 
 dmmW$..:OPPr"   c                 N  K   t        j                  |t        j                  |      d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   
      S 7 )w)r=   rr   ru   rv   rl   rm   rw   rx   Nr   r%   )	r
   rh   r	   r[   r'   r>   ra   r   r   rz   s         r!   r>   zApiKeyContext.update_async  s      yy -#**62
 ))B-"E.22tyytW 3 
 
 dmmW$..:OPP	
s   A7B%9B#:*B%c                     dj                  d | j                  j                         D              }dj                  |      S )r@   rA   c              3   F   K   | ]  \  }}d j                  ||        ywrC   rD   rF   s      r!   rJ   z)ApiKeyContext.__repr__.<locals>.<genexpr>1  rK   rL   z <Twilio.Iam.V1.ApiKeyContext {}>rM   rP   s     r!   rR   zApiKeyContext.__repr__+  s6     ((SDNN<P<P<RSS188AAr"   )rS   rT   rU   r   rW   r   rY   r,   r/   r   r3   r6   r
   rZ   r   r[   r:   r>   rR   r\   r]   s   @r!   r&   r&      s    ; ;c ;
U 
U
D 

~ 
(
> 
0 -3LL(.QS&[)Q ffn%Q 
	QD -3LL(.QS&[)Q ffn%Q 
	Q@B# Br"   r&   c                   P     e Zd Zdef 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 )
ApiKeyListr   c                 $    t         |   |       y)zh
        Initialize the ApiKeyList

        :param version: Version that contains the resource

        N)r   r   )r   r   r    s     r!   r   zApiKeyList.__init__7  s     	!r"   r   r#   c                 0    t        | j                  |      S z
        Constructs a ApiKeyContext

        :param sid: The Twilio-provided string that uniquely identifies the Key resource to update.
        r%   r&   r'   r   r   s     r!   r   zApiKeyList.get@       T]]44r"   c                 0    t        | j                  |      S r   r   r   s     r!   __call__zApiKeyList.__call__H  r   r"   c                      y)r@   z<Twilio.Iam.V1.ApiKeyList>r`   r(   s    r!   rR   zApiKeyList.__repr__P  s     ,r"   )rS   rT   rU   r   r   rW   r&   r   r   rR   r\   r]   s   @r!   r   r   5  sA    " "5s 5} 55C 5M 5,# ,r"   r   N)rV   r   typingr   r   r   r   twilio.baser   r	   r
   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   r   r&   r   r`   r"   r!   <module>r      sV     - - 6 6 8 : 2 '{C% {C|\BO \B~!, !,r"   