U
    ^g%i .                     @   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eeeef ee d fddZ	e
dddd	Zedd
dZedddZd dddZd dddZejejfeeef eeef d dddZejejfeeef eeef d dddZed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   Zrfc2822_datetimer   r   r   	_solution_context)selfr   r   r   	__class__ Y/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/iam/v1/api_key.pyr   !   s     zApiKeyInstance.__init__ApiKeyContextreturnc                 C   s&   | j dk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   s
   | j  S )i
        Deletes the ApiKeyInstance


        :returns: True if delete succeeds, False otherwise
        )r&   deleter%   r   r   r   r(   D   s    zApiKeyInstance.deletec                    s   | 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   s    zApiKeyInstance.delete_asyncc                 C   s
   | j  S )Y
        Fetch the ApiKeyInstance


        :returns: The fetched ApiKeyInstance
        )r&   fetchr%   r   r   r   r,   V   s    zApiKeyInstance.fetchc                    s   | j  I dH S )s
        Asynchronous coroutine to fetch the ApiKeyInstance


        :returns: The fetched ApiKeyInstance
        N)r&   fetch_asyncr%   r   r   r   r.   _   s    zApiKeyInstance.fetch_asyncr   r   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   r2   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
        r1   N)r&   update_asyncr3   r   r   r   r5   z   s    zApiKeyInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>   s     z*ApiKeyInstance.__repr__.<locals>.<genexpr>z!<Twilio.Iam.V1.ApiKeyInstance {}>joinr   itemsr:   r   contextr   r   r   __repr__   s    zApiKeyInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr&   boolr(   r*   r,   r.   r	   unsetr   objectr2   r5   rE   __classcell__r   r   r   r   r      s8   	  
 			



r   c                       s   e Zd Zeed fddZedddZedddZe	dd	d
Z
e	dddZejejfeeef eeef e	dddZejejfeeef eeef e	dddZedddZ  ZS )r    )r   r   c                    s*   t  | d|i| _djf | 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}N)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(   rP   r   rU   r   r   r   r(      s    
zApiKeyContext.deletec                    s$   t i }| jjd| j|dI dH S )r)   rQ   rR   N)r	   rV   r$   r*   rP   rW   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GETrR   r   r#   )r	   rV   r$   r,   rP   r   r   r   rU   r   r   r   r   r,      s    
zApiKeyContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r-   rX   rY   rZ   rR   Nr   r#   )r	   rV   r$   r.   rP   r   r   r[   r   r   r   r.      s    
  zApiKeyContext.fetch_asyncr/   c                 C   s\   t |t|d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r0   ZFriendlyNamePolicy!application/x-www-form-urlencodedContent-TyperX   rY   POSTrS   rT   datarU   r   r#   )	r	   rV   r   rN   r$   r2   rP   r   r   r   r   r   rb   rU   r   r   r   r   r2      s    
   zApiKeyContext.updatec                    sb   t |t|d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r4   r\   r^   r_   rX   rY   r`   ra   Nr   r#   )	r	   rV   r   rN   r$   r5   rP   r   r   rc   r   r   r   r5     s    
   zApiKeyContext.update_asyncc                 C   s$   d dd | j D }d|S )r6   r7   c                 s   s   | ]\}}d  ||V  qdS r8   r9   r;   r   r   r   r?   1  s     z)ApiKeyContext.__repr__.<locals>.<genexpr>z <Twilio.Iam.V1.ApiKeyContext {}>r@   rC   r   r   r   rE   +  s    zApiKeyContext.__repr__)rF   rG   rH   r   rJ   r   rL   r(   r*   r   r,   r.   r	   rM   r   rN   r2   r5   rE   rO   r   r   r   r   r       s(   

"

 r    c                       sP   e Zd Zed fddZeedddZeedddZed	d
dZ	  Z
S )
ApiKeyList)r   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   s   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   @  s    zApiKeyList.getc                 C   s   t | j|dS re   rf   rg   r   r   r   __call__H  s    zApiKeyList.__call__r!   c                 C   s   dS )r6   z<Twilio.Iam.V1.ApiKeyList>r   r%   r   r   r   rE   P  s    zApiKeyList.__repr__)rF   rG   rH   r   r   rJ   r    r   rh   rE   rO   r   r   r   r   rd   5  s   	rd   N)rI   r   typingr   r   r   r   Ztwilio.baser   r   r	   Ztwilio.base.instance_contextr
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r    rd   r   r   r   r   <module>   s   ~  