a
    !f                     @   s@   d dl mZmZmZ d dlmZ d dlmZ G dd deZ	dS )    )DictOptionalTuple)Response)Clientc                   @   s   e Zd ZdZeedddZeedddZdeeee	ee
f  ee	ee
f  ee	eef  eeeef  ee eed
	ddZdeeee	ee
f  ee	ee
f  ee	eef  eeeef  ee eed
	ddZdS )Domainzg
    This represents at Twilio API subdomain.

    Like, `api.twilio.com` or `lookups.twilio.com'.
    twiliobase_urlc                 C   s   || _ || _d S )Nr   )selfr	   r
    r   S/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/base/domain.py__init__   s    zDomain.__init__)urireturnc                 C   s   d | jd|dS )z
        Converts a relative `uri` to an absolute url.
        :param string uri: The relative uri to make absolute.
        :return: An absolute url (based off this domain)
        z{}/{}/)formatr
   strip)r   r   r   r   r   absolute_url   s    zDomain.absolute_urlNF)	methodr   paramsdataheadersauthtimeoutallow_redirectsr   c	           
   
   C   s&   |  |}	| jj||	||||||dS )a  
        Makes an HTTP request to this domain.
        :param method: The HTTP method.
        :param uri: The HTTP uri.
        :param params: Query parameters.
        :param data: The request body.
        :param headers: The HTTP headers.
        :param auth: Basic auth tuple of (username, password)
        :param timeout: The request timeout.
        :param allow_redirects: True if the client should follow HTTP
        redirects.
        r   r   r   r   r   r   )r   r	   request
r   r   r   r   r   r   r   r   r   urlr   r   r   r      s    
zDomain.requestc	           
   
      s,   |  |}	| jj||	||||||dI dH S )a  
        Makes an asynchronous HTTP request to this domain.
        :param method: The HTTP method.
        :param uri: The HTTP uri.
        :param params: Query parameters.
        :param data: The request body.
        :param headers: The HTTP headers.
        :param auth: Basic auth tuple of (username, password)
        :param timeout: The request timeout.
        :param allow_redirects: True if the client should follow HTTP
        redirects.
        r   N)r   r	   request_asyncr   r   r   r   r    <   s    
zDomain.request_async)NNNNNF)NNNNNF)__name__
__module____qualname____doc__r   strr   r   r   r   objectr   floatboolr   r   r    r   r   r   r   r      sJ         '      r   N)
typingr   r   r   Ztwilio.http.responser   Ztwilio.restr   r&   r   r   r   r   r   <module>   s   