import abc
from ..schema.base_schema import BlobValue as BlobValue, Device as Device, LogValue as LogValue, Network as Network, NumberValue as NumberValue, State as State, StringValue as StringValue, WappstoMethods as WappstoMethods, XmlValue as XmlValue
from abc import ABC, abstractmethod
from enum import Enum
from typing import Callable, List, Optional, Union
from uuid import UUID

class StatusID(str, Enum):
    IDLE: str
    SENDING: str
    SENDERROR: str
    SEND: str
    ERROR: str

class ServiceClass(ABC, metaclass=abc.ABCMeta):
    def close(self) -> None: ...
    def ping(self) -> None: ...
    @abstractmethod
    def subscribe_network_event(self, uuid: UUID, callback: Callable[[Network, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def unsubscribe_network_event(self, uuid: UUID, callback: Callable[[Network, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def post_network(self, data) -> bool: ...
    @abstractmethod
    def put_network(self, uuid: UUID, data) -> bool: ...
    @abstractmethod
    def get_network(self, uuid: UUID) -> Union[Network, None]: ...
    @abstractmethod
    def delete_network(self, uuid: UUID) -> bool: ...
    @abstractmethod
    def subscribe_device_event(self, uuid: UUID, callback: Callable[[Device, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def unsubscribe_device_event(self, uuid: UUID, callback: Callable[[Device, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def post_device(self, network_uuid: UUID, data: Device) -> bool: ...
    @abstractmethod
    def put_device(self, uuid: UUID, data: Device) -> bool: ...
    @abstractmethod
    def get_device_where(self, network_uuid: UUID, **kwargs: str) -> Optional[UUID]: ...
    @abstractmethod
    def get_device(self, uuid: UUID) -> Union[Device, None]: ...
    @abstractmethod
    def delete_device(self, uuid: UUID) -> bool: ...
    ValueUnion = Union[StringValue, NumberValue, BlobValue, XmlValue]
    @abstractmethod
    def subscribe_value_event(self, uuid: UUID, callback: Callable[[ValueUnion, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def unsubscribe_value_event(self, uuid: UUID, callback: Callable[[Device, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def post_value(self, device_uuid: UUID, data: ValueUnion) -> bool: ...
    @abstractmethod
    def put_value(self, uuid: UUID, data: ValueUnion) -> bool: ...
    @abstractmethod
    def get_value_where(self, device_uuid: UUID, **kwargs: str) -> Optional[UUID]: ...
    @abstractmethod
    def get_value(self, uuid: UUID) -> Union[ValueUnion, None]: ...
    @abstractmethod
    def delete_value(self, uuid: UUID) -> bool: ...
    @abstractmethod
    def subscribe_state_event(self, uuid: UUID, callback: Callable[[State, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def unsubscribe_state_event(self, uuid: UUID, callback: Callable[[Device, WappstoMethods], None]) -> None: ...
    @abstractmethod
    def post_state(self, value_uuid: UUID, data: State) -> bool: ...
    @abstractmethod
    def put_bulk_state(self, uuid: UUID, data: List[LogValue]) -> bool: ...
    @abstractmethod
    def put_state(self, uuid: UUID, data: State) -> bool: ...
    @abstractmethod
    def get_state(self, uuid: UUID) -> Union[State, None]: ...
    @abstractmethod
    def delete_state(self, uuid: UUID) -> bool: ...
