
    d{i_Q                         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 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)ApiResponse)InstanceContext)InstanceResource)ListResource)Versionc                       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efd
ZdefdZddZd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d f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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 )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       X/home/sas/my/fyp/ringai/.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._proxy6   s9     == )NN5)DM }}r#   c                 6    | j                   j                         S zi
        Deletes the ApiKeyInstance


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


        :returns: True if delete succeeds, False otherwise
        N)r*   delete_asyncr)   s    r"   r0   zApiKeyInstance.delete_asyncN   s!      [[--////   '%'c                 6    | j                   j                         S )z
        Deletes the ApiKeyInstance with HTTP info


        :returns: ApiResponse with success boolean, status code, and headers
        )r*   delete_with_http_infor)   s    r"   r3   z$ApiKeyInstance.delete_with_http_infoW   s     {{0022r#   c                 R   K   | j                   j                          d{   S 7 w)z
        Asynchronous coroutine that deletes the ApiKeyInstance with HTTP info


        :returns: ApiResponse with success boolean, status code, and headers
        N)r*   delete_with_http_info_asyncr)   s    r"   r5   z*ApiKeyInstance.delete_with_http_info_async`   s!      [[<<>>>>r1   c                 6    | j                   j                         S )Y
        Fetch the ApiKeyInstance


        :returns: The fetched ApiKeyInstance
        )r*   fetchr)   s    r"   r8   zApiKeyInstance.fetchi   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"   r;   zApiKeyInstance.fetch_asyncr   s!      [[,,....r1   c                 6    | j                   j                         S )z
        Fetch the ApiKeyInstance with HTTP info


        :returns: ApiResponse with instance, status code, and headers
        )r*   fetch_with_http_infor)   s    r"   r=   z#ApiKeyInstance.fetch_with_http_info{   s     {{//11r#   c                 R   K   | j                   j                          d{   S 7 w)z
        Asynchronous coroutine to fetch the ApiKeyInstance with HTTP info


        :returns: ApiResponse with instance, status code, and headers
        N)r*   fetch_with_http_info_asyncr)   s    r"   r?   z)ApiKeyInstance.fetch_with_http_info_async   s!      [[;;====r1   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"   rC   zApiKeyInstance.update   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
        rB   N)r*   update_asyncrD   s      r"   rG   zApiKeyInstance.update_async   s4      [[--' . 
 
 	
 
   !*(*c                 <    | j                   j                  ||      S )af  
        Update the ApiKeyInstance with HTTP info

        :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: ApiResponse with instance, status code, and headers
        rB   )r*   update_with_http_inforD   s      r"   rJ   z$ApiKeyInstance.update_with_http_info   s&     {{00' 1 
 	
r#   c                 X   K   | j                   j                  ||       d{   S 7 w)a  
        Asynchronous coroutine to update the ApiKeyInstance with HTTP info

        :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: ApiResponse with instance, status code, and headers
        rB   N)r*   update_with_http_info_asyncrD   s      r"   rL   z*ApiKeyInstance.update_with_http_info_async   s4      [[<<' = 
 
 	
 
rH   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   itemsrS   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-   r0   r   r3   r5   r8   r;   r=   r?   r
   unsetr   objectrC   rG   rJ   rL   r`   __classcell__r!   s   @r"   r   r      s    OS66)-c3h6>Fsm6(  $ $0D 03{ 3?; ?#/2k 2>+ > -3LL(.
S&[)
 ffn%
 
	
( -3LL(.
S&[)
 ffn%
 
	
( -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defd	Zde
fd
ZdefdZde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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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   rS   _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 )z
        Internal helper for delete operation

        Returns:
            tuple: (success_boolean, status_code, headers)
        DELETEmethoduriheaders)r
   ofr(   delete_with_response_inforo   r    ru   s     r"   _deletezApiKeyContext._delete   s8     ))B-}}66G 7 
 	
r#   c                 .    | j                         \  }}}|S r,   )ry   r    success_s      r"   r-   zApiKeyContext.delete   s     Ar#   c                 F    | j                         \  }}}t        |||      S )z
        Deletes the ApiKeyInstance and return response metadata


        :returns: ApiResponse with success boolean, status code, and headers
        datastatus_coderu   )ry   r   r    r|   r   ru   s       r"   r3   z#ApiKeyContext.delete_with_http_info  s%     )-%g['RRr#   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)z
        Internal async helper for delete operation

        Returns:
            tuple: (success_boolean, status_code, headers)
        rq   rr   N)r
   rv   r(   delete_with_response_info_asyncro   rx   s     r"   _delete_asynczApiKeyContext._delete_async  sG      ))B-]]BBG C 
 
 	
 
s   AA
AA
c                 J   K   | j                          d{   \  }}}|S 7 
wr/   )r   r{   s      r"   r0   zApiKeyContext.delete_async   s)      #0022A 3s   #!#c                 b   K   | j                          d{   \  }}}t        |||      S 7 w)z
        Asynchronous coroutine that deletes the ApiKeyInstance and return response metadata


        :returns: ApiResponse with success boolean, status code, and headers
        Nr   )r   r   r   s       r"   r5   z)ApiKeyContext.delete_with_http_info_async*  s5      /3.@.@.B(B%g['RR )Cs   /-/c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      S )zz
        Internal helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        application/jsonAcceptGETrr   )r
   rv   r(   fetch_with_response_inforo   rx   s     r"   _fetchzApiKeyContext._fetch4  sB     ))B-.}}55dii 6 
 	
r#   c                 t    | j                         \  }}}t        | j                  || j                  d         S )r7   r   r&   )r   r   r(   r   r    r   r}   s      r"   r8   zApiKeyContext.fetchD  s8     AMMu%
 	
r#   c                     | j                         \  }}}t        | j                  || j                  d         }t	        |||      S )z
        Fetch the ApiKeyInstance and return response metadata


        :returns: ApiResponse with instance, status code, and headers
        r   r&   r   )r   r   r(   r   r   r    r   r   ru   instances        r"   r=   z"ApiKeyContext.fetch_with_http_infoR  sG     )-%g!MMu%

 k7SSr#   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   S 7 w)z
        Internal async helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        r   r   r   rr   N)r
   rv   r(   fetch_with_response_info_asyncro   rx   s     r"   _fetch_asynczApiKeyContext._fetch_asynca  sQ      ))B-.]]AAdii B 
 
 	
 
s   AAA	Ac                    K   | j                          d{   \  }}}t        | j                  || j                  d         S 7 -w)r:   Nr   r&   )r   r   r(   r   r   s      r"   r;   zApiKeyContext.fetch_asyncq  sG      #//11AMMu%
 	
 2s   AA.Ac                    K   | j                          d{   \  }}}t        | j                  || j                  d         }t	        |||      S 7 ;w)z
        Asynchronous coroutine to fetch the ApiKeyInstance and return response metadata


        :returns: ApiResponse with instance, status code, and headers
        Nr   r&   r   )r   r   r(   r   r   r   s        r"   r?   z(ApiKeyContext.fetch_with_http_info_async  sW      /3.?.?.A(A%g!MMu%

 k7SS )Bs   AA<Ar   r   c                     t        j                  |t        j                  |      d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      S )z{
        Internal helper for update operation

        Returns:
            tuple: (payload, status_code, headers)
        FriendlyNamePolicy!application/x-www-form-urlencodedContent-Typer   r   POSTrs   rt   r   ru   )r
   rv   r	   ri   r(   update_with_response_inforo   r    r   r   r   ru   s        r"   _updatezApiKeyContext._update  st     yy -#**62
 ))B-"E.}}66tyytW 7 
 	
r#   c                 z    | j                  ||      \  }}}t        | j                  || j                  d         S )rA   rB   r   r&   )r   r   r(   r   r    r   r   r   r}   s        r"   rC   zApiKeyContext.update  s8     =PAdmmW$..:OPPr#   c                     | j                  ||      \  }}}t        | j                  || j                  d         }t	        |||      S )at  
        Update the ApiKeyInstance and return response metadata

        :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: ApiResponse with instance, status code, and headers
        rB   r   r&   r   )r   r   r(   r   r   r    r   r   r   r   ru   r   s          r"   rJ   z#ApiKeyContext.update_with_http_info  sO     )-' )5 )
%g "$--dnnU>STk7SSr#   c                   K   t        j                  |t        j                  |      d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   S 7 w)	z
        Internal async helper for update operation

        Returns:
            tuple: (payload, status_code, headers)
        r   r   r   r   r   r   r   N)r
   rv   r	   ri   r(   update_with_response_info_asyncro   r   s        r"   _update_asynczApiKeyContext._update_async  s      yy -#**62
 ))B-"E.]]BBtyytW C 
 
 	
 
s   A7B 9A>:B c                    K   | j                  ||       d{   \  }}}t        | j                  || j                  d         S 7 -w)rF   rB   Nr   r&   )r   r   r(   r   r   s        r"   rG   zApiKeyContext.update_async  sP      #00' 1 
 
A dmmW$..:OPP
s   A	A.A	c                    K   | j                  ||       d{   \  }}}t        | j                  || j                  d         }t	        |||      S 7 ;w)a  
        Asynchronous coroutine to update the ApiKeyInstance and return response metadata

        :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: ApiResponse with instance, status code, and headers
        rB   Nr   r&   r   )r   r   r(   r   r   r   s          r"   rL   z)ApiKeyContext.update_with_http_info_async  s`      /3.@.@' /A /
 )
%g "$--dnnU>STk7SS	)
s   AA<Ac                     dj                  d | j                  j                         D              }dj                  |      S )rN   rO   c              3   F   K   | ]  \  }}d j                  ||        ywrQ   rR   rT   s      r"   rX   z)ApiKeyContext.__repr__.<locals>.<genexpr>  rY   rZ   z <Twilio.Iam.V1.ApiKeyContext {}>r[   r^   s     r"   r`   zApiKeyContext.__repr__  s6     ((SDNN<P<P<RSS188AAr#   )"ra   rb   rc   r   re   r   tuplery   rg   r-   r   r3   r   r0   r5   r   r   r8   r=   r   r;   r?   r
   rh   r   ri   r   rC   rJ   r   rG   rL   r`   rj   rk   s   @r"   r'   r'      s^   ; ;c ;
 
 S{ S
U 
D S; S
 
 
~ 
Tk T
E 
 
> 
T+ T" -3LL(.
S&[)
 ffn%
 
	
< -3LL(.QS&[)Q ffn%Q 
	Q$ -3LL(.TS&[)T ffn%T 
	T* -3LL(.
S&[)
 ffn%
 
	
< -3LL(.QS&[)Q ffn%Q 
	Q( -3LL(.TS&[)T ffn%T 
	T&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__  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__+  r   r#   c                      y)rN   z<Twilio.Iam.V1.ApiKeyList>rn   r)   s    r"   r`   zApiKeyList.__repr__3  s     ,r#   )ra   rb   rc   r   r   re   r'   r   r   r`   rj   rk   s   @r"   r   r     sA    " "5s 5} 55C 5M 5,# ,r#   r   N)rd   r   typingr   r   r   r   twilio.baser   r	   r
   twilio.base.api_responser   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   r   r'   r   rn   r#   r"   <module>r      sY     - - 6 6 0 8 : 2 'CC% CCLvBO vBr	!, !,r#   