o
    /h                     @  sd   d dl mZ d dlmZmZ d dlmZmZmZ d dl	m
Z
mZ ddlmZmZ G dd deZd	S )
    )annotations)ABCabstractmethod)DictOptionalUnion)	BasicAuthTimeout   )AsyncClient
SyncClientc                   @  sN   e Zd ZdZddd!ddZe	d"d#ddZdddd$ddZd%dd ZdS )&BasePostgrestClientzBase PostgREST client.T)verifybase_urlstrschemaheadersDict[str, str]timeoutUnion[int, float, Timeout]r   boolreturnNonec                C  s(   i |||d}|  ||||| _d S )NzAccept-ProfilezContent-Profile)create_sessionsession)selfr   r   r   r   r    r   N/var/www/html/govbot/env/lib/python3.10/site-packages/postgrest/base_client.py__init__   s   	zBasePostgrestClient.__init__Union[SyncClient, AsyncClient]c                 C  s   t  )N)NotImplementedError)r   r   r   r   r   r   r   r   r      s   z"BasePostgrestClient.create_sessionN )usernamepasswordtokenOptional[str]r#   Union[str, bytes, None]r$   Union[str, bytes]c                C  s8   |rd| | j jd< | S |rt||| j _| S td)a  
        Authenticate the client with either bearer token or basic authentication.

        Raises:
            `ValueError`: If neither authentication scheme is provided.

        .. note::
            Bearer token is preferred if both ones are provided.
        zBearer Authorizationz?Neither bearer token or basic authentication scheme is provided)r   r   r   auth
ValueError)r   r%   r#   r$   r   r   r   r*   (   s   zBasePostgrestClient.authc                 C  s   | j j||d | S )zSwitch to another schema.r   )r   r   update)r   r   r   r   r   r   B   s   zBasePostgrestClient.schema)r   r   r   r   r   r   r   r   r   r   r   r   )T)
r   r   r   r   r   r   r   r   r   r    )r%   r&   r#   r'   r$   r(   )r   r   )	__name__
__module____qualname____doc__r   r   r   r*   r   r   r   r   r   r      s    	r   N)
__future__r   abcr   r   typingr   r   r   httpxr   r	   utilsr   r   r   r   r   r   r   <module>   s    