import httpx
from _typeshed import Incomplete
from collections.abc import Callable as Callable
from connectsensor.const import APIResponse as APIResponse, APIVersion as APIVersion, API_BASE_URL as API_BASE_URL, DEFAULT_API_VERSION as DEFAULT_API_VERSION, HTTP_UNAUTHORIZED as HTTP_UNAUTHORIZED, SOAP_NS_PREFIX as SOAP_NS_PREFIX, TOKEN as TOKEN, WSDL_URL as WSDL_URL
from connectsensor.exceptions import KingspanAPIError as KingspanAPIError, KingspanInvalidCredentialsError as KingspanInvalidCredentialsError, KingspanTimeoutError as KingspanTimeoutError
from connectsensor.tank import AsyncTank as AsyncTank, Tank as Tank
from datetime import datetime
from zeep.transports import Transport

POST_HEADERS: Incomplete

class HttpxTransport(Transport):
    client: Incomplete
    def __init__(self) -> None: ...
    def post(self, address: str, envelope: bytes | None, headers: dict) -> httpx.Response: ...

class _BaseClient:
    def __init__(self, version: APIVersion = ...) -> None: ...
    def redact_response(self, obj: APIResponse) -> APIResponse: ...
    def check_response(self, response: object) -> APIResponse: ...
    def handle_exception(self, exc: Exception) -> None: ...
    def login_request(self, username: str, password: str) -> tuple[Callable, list, dict]: ...
    def login_response(self, response: httpx.Response | object, tank_type: type) -> None: ...
    def get_latest_level_request(self, signalman_no: str) -> tuple[Callable, list, dict]: ...
    def get_history_request(self, signalman_no: str, start_date: datetime | None = None, end_date: datetime | None = None) -> tuple[Callable, list, dict]: ...

class SensorClient(_BaseClient):
    def __init__(self, version: APIVersion = ...) -> 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: ...
    @property
    async def tanks(self) -> list[AsyncTank]: ...
