U
    ^g%i^+                     @   s   d Z ddlmZ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	 d	eZG d
d de	ZG dd deZdS )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Lookups
    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.
    )AnyDictOptionalUnion)values)InstanceContext)InstanceResource)ListResource)Versionc                       s   e Zd ZG dd deZdeeeef e	e 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feeef d dddZejfeeef d dddZedddZ  ZS )BucketInstancec                   @   s.   e Zd ZdZeeef dddZdd ZdS )zBucketInstance.RateLimitRequestk
        :ivar limit: Limit of requests for the bucket
        :ivar ttl: Time to live of the rule
        payloadc                 C   s   | d| _| d| _d S Nlimitttlgetr   r   selfr    r   \/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/lookups/v2/bucket.py__init__   s    z(BucketInstance.RateLimitRequest.__init__c                 C   s   | j | jdS Nr   r   r   r   r   r   r   to_dict$   s    z'BucketInstance.RateLimitRequest.to_dictN	__name__
__module____qualname____doc__r   strr   r   r   r   r   r   r   RateLimitRequest   s   r#   N)versionr   fieldbucketc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|p| j|p| j	d
| _d | _d S )Ncodemessage	more_infostatusr%   r   r&   ownerr   r%   r&   )superr   r   r'   r(   r)   r*   r%   r   r&   r+   r   	_solution_context)r   r$   r   r%   r&   	__class__r   r   r   6   s    zBucketInstance.__init__BucketContextreturnc                 C   s.   | j dkr(t| j| jd | 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: BucketContext for this BucketInstance
        Nr%   r&   r,   )r/   r2   _versionr.   r   r   r   r   _proxyO   s    
zBucketInstance._proxyc                 C   s
   | j  S )i
        Deletes the BucketInstance


        :returns: True if delete succeeds, False otherwise
        )r6   deleter   r   r   r   r8   _   s    zBucketInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the BucketInstance


        :returns: True if delete succeeds, False otherwise
        N)r6   delete_asyncr   r   r   r   r:   h   s    zBucketInstance.delete_asyncc                 C   s
   | j  S )Y
        Fetch the BucketInstance


        :returns: The fetched BucketInstance
        )r6   fetchr   r   r   r   r<   q   s    zBucketInstance.fetchc                    s   | j  I dH S )s
        Asynchronous coroutine to fetch the BucketInstance


        :returns: The fetched BucketInstance
        N)r6   fetch_asyncr   r   r   r   r>   z   s    zBucketInstance.fetch_asyncrate_limit_requestr4   c                 C   s   | j j|dS )}
        Update the BucketInstance

        :param rate_limit_request:

        :returns: The updated BucketInstance
        r@   )r6   updater   r@   r   r   r   rC      s    
zBucketInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the BucketInstance

        :param rate_limit_request:

        :returns: The updated BucketInstance
        rB   N)r6   update_asyncrD   r   r   r   rF      s    
zBucketInstance.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*BucketInstance.__repr__.<locals>.<genexpr>z%<Twilio.Lookups.V2.BucketInstance {}>joinr.   itemsrK   r   contextr   r   r   __repr__   s    zBucketInstance.__repr__)NN)r   r   r    objectr#   r
   r   r"   r   r   r   propertyr6   boolr8   r:   r<   r>   r   unsetr   rC   rF   rV   __classcell__r   r   r0   r   r      s4   !  
			


r   c                       s   e Zd ZG dd deZe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feeef edddZejfeeef edddZedddZ  ZS )r2   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )zBucketContext.RateLimitRequestr   r   c                 C   s   | d| _| d| _d S r   r   r   r   r   r   r      s    z'BucketContext.RateLimitRequest.__init__c                 C   s   | j | jdS r   r   r   r   r   r   r      s    z&BucketContext.RateLimitRequest.to_dictNr   r   r   r   r   r#      s   r#   )r$   r%   r&   c                    s,   t  | ||d| _djf | j| _dS )z
        Initialize the BucketContext

        :param version: Version that contains the resource
        :param field: field name
        :param bucket: bucket name
        r,   z*/RateLimits/Fields/{field}/Bucket/{bucket}N)r-   r   r.   rK   _uri)r   r$   r%   r&   r0   r   r   r      s    zBucketContext.__init__r3   c                 C   s&   t i }d|d< | jjd| j|dS )r7   application/jsonAcceptDELETEmethoduriheaders)r   ofr5   r8   r\   r   rc   r   r   r   r8      s    
zBucketContext.deletec                    s,   t i }d|d< | jjd| j|dI dH S )r9   r]   r^   r_   r`   N)r   rd   r5   r:   r\   re   r   r   r   r:      s    
  zBucketContext.delete_asyncc                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r;   r]   r^   GETr`   r%   r&   r,   )r   rd   r5   r<   r\   r   r.   r   rc   r   r   r   r   r<      s    
zBucketContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r=   r]   r^   rf   r`   Nr%   r&   r,   )r   rd   r5   r>   r\   r   r.   rg   r   r   r   r>     s    
  zBucketContext.fetch_asyncr?   c                 C   sV   |  }ti }d|d< d|d< | jjd| j||d}t| j|| jd | jd dS )	rA   r]   Content-Typer^   PUTra   rb   datarc   r%   r&   r,   )r   r   rd   r5   rC   r\   r   r.   r   r@   rk   rc   r   r   r   r   rC     s     

   zBucketContext.updatec                    s\   |  }ti }d|d< d|d< | jjd| j||dI dH }t| j|| jd | jd d	S )
rE   r]   rh   r^   ri   rj   Nr%   r&   r,   )r   r   rd   r5   rF   r\   r   r.   rl   r   r   r   rF   6  s     

   zBucketContext.update_asyncc                 C   s$   d dd | j D }d|S )rG   rH   c                 s   s   | ]\}}d  ||V  qdS rI   rJ   rL   r   r   r   rP   Y  s     z)BucketContext.__repr__.<locals>.<genexpr>z$<Twilio.Lookups.V2.BucketContext {}>rQ   rT   r   r   r   rV   S  s    zBucketContext.__repr__)r   r   r    rW   r#   r
   r"   r   rY   r8   r:   r   r<   r>   r   rZ   r   rC   rF   rV   r[   r   r   r0   r   r2      s"   

r2   c                       sd   e Zd ZG dd deZed fddZeeedddZ	eeedd	d
Z
edddZ  ZS )
BucketListc                   @   s.   e Zd ZdZeeef dddZdd ZdS )zBucketList.RateLimitRequestr   r   c                 C   s   | d| _| d| _d S r   r   r   r   r   r   r   e  s    z$BucketList.RateLimitRequest.__init__c                 C   s   | j | jdS r   r   r   r   r   r   r   j  s    z#BucketList.RateLimitRequest.to_dictNr   r   r   r   r   r#   _  s   r#   )r$   c                    s   t  | dS )zh
        Initialize the BucketList

        :param version: Version that contains the resource

        N)r-   r   )r   r$   r0   r   r   r   p  s    zBucketList.__init__)r%   r&   r4   c                 C   s   t | j||dS zq
        Constructs a BucketContext

        :param field: field name
        :param bucket: bucket name
        r,   r2   r5   r   r%   r&   r   r   r   r   y  s    zBucketList.getc                 C   s   t | j||dS rn   ro   rp   r   r   r   __call__  s    zBucketList.__call__r3   c                 C   s   dS )rG   z<Twilio.Lookups.V2.BucketList>r   r   r   r   r   rV     s    zBucketList.__repr__)r   r   r    rW   r#   r
   r   r"   r2   r   rq   rV   r[   r   r   r0   r   rm   ]  s
   			rm   N)r!   typingr   r   r   r   Ztwilio.baser   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer	   Ztwilio.base.versionr
   r   r2   rm   r   r   r   r   <module>   s     5