from datetime import datetime

import httpx
from async_property import async_property

from connectsensor.const import (
    APIRequest,
    APIResponse,
    APIVersion,
)
from connectsensor.tank import AsyncTank, Tank

class _BaseClient:
    def __init__(self, version: APIVersion = ...) -> None: ...
    def redact(self, obj: APIResponse) -> APIResponse: ...
    def build_request(
        self,
        endpoint: str,
        data: dict[str, str | list | dict],
    ) -> tuple: ...
    def check_payload(self, response: httpx.Response) -> APIResponse: ...
    def httpx_exception(self, exc: Exception) -> None: ...
    def get_history_request(
        self,
        signalman_no: str,
        start_date: datetime | None = None,
        end_date: datetime | None = None,
    ) -> tuple[str, APIRequest]: ...

class SensorClient(_BaseClient):
    def __init__(self, version) -> None: ...
    def login(self, username: str, password: str) -> None: ...
    @property
    def tanks(self) -> list[Tank]: ...

class AsyncSensorClient(_BaseClient):
    async def __aenter__(self) -> AsyncSensorClient: ...
    async def __aexit__(self, exc_t, exc_v, exc_tb) -> None: ...
    async def login(self, username: str, password: str) -> None: ...
    @async_property
    async def tanks(self) -> list[AsyncTank]: ...
