o
    f>h .                     @   s   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
 d
eZG dd deZG dd deZdS )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                       s   e Zd ZdZ	ddedeeef dee f fddZ	e
dd
dZdefddZdefddZdddZdddZejejfdeeef deeef dd fddZejejfdeeef deeef dd fddZdefddZ  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).
    Nversionpayloadsidc                    sn   t  | |d| _|d| _t|d| _t|d| _|d| _	d|p/| ji| _
d | _d S )Nr   friendly_namedate_createddate_updatedpolicy)super__init__getr   r   r   rfc2822_datetimer   r   r   	_solution_context)selfr   r   r   	__class__ M/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/iam/v1/api_key.pyr   !   s   

zApiKeyInstance.__init__returnApiKeyContextc                 C   s&   | j du rt| j| jd 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
        Nr   r   )r   r"   _versionr   r   r   r   r    _proxy5   s   
zApiKeyInstance._proxyc                 C   
   | j  S )i
        Deletes the ApiKeyInstance


        :returns: True if delete succeeds, False otherwise
        )r&   deleter%   r   r   r    r)   D      
zApiKeyInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the ApiKeyInstance


        :returns: True if delete succeeds, False otherwise
        N)r&   delete_asyncr%   r   r   r    r-   M      zApiKeyInstance.delete_asyncc                 C   r'   )Y
        Fetch the ApiKeyInstance


        :returns: The fetched ApiKeyInstance
        )r&   fetchr%   r   r   r    r0   V   r*   zApiKeyInstance.fetchc                    r+   )s
        Asynchronous coroutine to fetch the ApiKeyInstance


        :returns: The fetched ApiKeyInstance
        N)r&   fetch_asyncr%   r   r   r    r2   _   r.   zApiKeyInstance.fetch_asyncr   r   c                 C   s   | j j||d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   r   r   r    r5   h   s   zApiKeyInstance.updatec                    s   | j j||dI dH S )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
        r4   N)r&   update_asyncr6   r   r   r    r8   z   s
   zApiKeyInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r    	<genexpr>       z*ApiKeyInstance.__repr__.<locals>.<genexpr>z!<Twilio.Iam.V1.ApiKeyInstance {}>joinr   itemsr?   r   contextr   r   r    __repr__      
zApiKeyInstance.__repr__)N)r!   r"   )r!   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr&   boolr)   r-   r0   r2   r	   unsetr   objectr5   r8   rK   __classcell__r   r   r   r    r      sF    	
	
	
	





r   c                       s   e Zd Zdedef fddZdefddZdefdd	Zde	fd
dZ
de	fddZejejfdeeef deeef de	fddZejejfdeeef deeef de	fddZdefddZ  ZS )r"   r   r   c                    s.   t  | d|i| _djdi | j| _dS )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}Nr   )r   r   r   r?   _uri)r   r   r   r   r   r    r      s   zApiKeyContext.__init__r!   c                 C   s   t i }| jjd| j|dS )r(   DELETEmethoduriheaders)r	   ofr$   r)   rW   r   r\   r   r   r    r)      s   
zApiKeyContext.deletec                    s&   t i }| jjd| j|dI dH S )r,   rX   rY   N)r	   r]   r$   r-   rW   r^   r   r   r    r-      s
   
zApiKeyContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r/   application/jsonAcceptGETrY   r   r#   )r	   r]   r$   r0   rW   r   r   r   r\   r   r   r   r    r0      s   
zApiKeyContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r1   r_   r`   ra   rY   Nr   r#   )r	   r]   r$   r2   rW   r   r   rb   r   r   r    r2      s   
zApiKeyContext.fetch_asyncr   r   c                 C   s\   t |t|d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r3   FriendlyNamePolicy!application/x-www-form-urlencodedContent-Typer_   r`   POSTrZ   r[   datar\   r   r#   )	r	   r]   r   rU   r$   r5   rW   r   r   r   r   r   rj   r\   r   r   r   r    r5      s   

zApiKeyContext.updatec                    sd   t |t|d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r7   rc   rf   rg   r_   r`   rh   ri   Nr   r#   )	r	   r]   r   rU   r$   r8   rW   r   r   rk   r   r   r    r8     s   

zApiKeyContext.update_asyncc                 C   r9   )r:   r;   c                 s   r<   r=   r>   r@   r   r   r    rD   1  rE   z)ApiKeyContext.__repr__.<locals>.<genexpr>z <Twilio.Iam.V1.ApiKeyContext {}>rF   rI   r   r   r    rK   +  rL   zApiKeyContext.__repr__)rM   rN   rO   r   rQ   r   rS   r)   r-   r   r0   r2   r	   rT   r   rU   r5   r8   rK   rV   r   r   r   r    r"      s2    


"


 r"   c                       sT   e Zd Zdef fddZdedefddZdedefdd	Zdefd
dZ	  Z
S )
ApiKeyListr   c                    s   t  | dS )zh
        Initialize the ApiKeyList

        :param version: Version that contains the resource

        N)r   r   )r   r   r   r   r    r   7  s   zApiKeyList.__init__r   r!   c                 C      t | j|dS z
        Constructs a ApiKeyContext

        :param sid: The Twilio-provided string that uniquely identifies the Key resource to update.
        r#   r"   r$   r   r   r   r   r    r   @     zApiKeyList.getc                 C   rm   rn   ro   rp   r   r   r    __call__H  rq   zApiKeyList.__call__c                 C   s   dS )r:   z<Twilio.Iam.V1.ApiKeyList>r   r%   r   r   r    rK   P  s   zApiKeyList.__repr__)rM   rN   rO   r   r   rQ   r"   r   rr   rK   rV   r   r   r   r    rl   5  s
    	rl   N)rP   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"   rl   r   r   r   r    <module>   s    ~  