from typing import Any, List, Optional
from datetime import datetime

class AdroitConfig:
    def AlarmTag(self, Agent: str, AlarmAgent: str, Type: str, Route: int, Ack: int, TypeEnum: int) -> Any:
        """Configure or remove an alarm for an agent/tag.

        Args:
            Agent: Agent name or "agent.slot".
            AlarmAgent: Alarm handler name.
            Type: Alarm type name (use TypeEnum if empty).
            Route: Alarm route number. Use -1 to delete the alarm.
            Ack: 1 if alarm must be acknowledgeable, else 0.
            TypeEnum: Numeric type enum (use -1 when Type is provided).

        Returns:
            Any: COM/driver result object (implementation-specific).

        Raises:
            RuntimeError: on failure.
        """
    def Connect(self, Computer: Optional[str], Server: Optional[str]) -> Any:
        """Connect to an Agent Server.

        Args:
            Computer: Remote computer name (None or empty for local).
            Server: Agent Server name.

        Returns:
            Any: Connection result/object.

        Raises:
            ConnectionError: if the connection fails.
        """
    def CreateAgent(self, Name: str, Description: Optional[str], Type: Optional[str]) -> Any:
        """Create a new agent on the connected server.

        Args:
            Name: Agent name.
            Description: Optional description.
            Type: Optional agent type.

        Returns:
            Any: Result object or success indicator.

        Raises:
            RuntimeError: on failure.
        """
    def Join(self, Group: str, MemberList: Optional[str]) -> Any:
        """Add agents to a group.

        Args:
            Group: Group name.
            MemberList: Comma-separated agent names.

        Returns:
            Any: Result object.
        """
    def Leave(self, Group: str, MemberList: Optional[str]) -> Any:
        """Remove agents from a group.

        Args:
            Group: Group name.
            MemberList: Comma-separated agent names.

        Returns:
            Any: Result object.
    """
    def LogTag(self, Agent: str, Slot: str, Set: int, Period: int, Rate: int, Filename: Optional[str]) -> Any:
        """Configure historical logging for an agent or tag.

        Args:
            Agent: Agent or "agent.slot".
            Slot: Slot name (ignored if Agent contains slot).
            Set: Logging set number.
            Period: Log period (hours).
            Rate: Minimum logging interval (seconds).
            Filename: Optional path to datalog file.
        
        Note:
            To delete the historical data logging for this Adroit tag, use the RemoveAgent function and specify the following name: "LOG$Agent$Slot", where Agent, is the specified Agent name and Slot is the specified slot that was logged. For instance, to remove the logging for the example above, type the following: p = adroit.RemoveAgent("LOG$ANA-01$rawValue")

        Returns:
            Any: Result object.
        """
    def RemoveAgent(self, Name: str) -> Any:
        """Remove an agent from the connected server.

        Args:
            Name: Agent name.

        Returns:
            Any: Result object.
        """
    def ScanTag(self, Agent: str, Slot: str, Device: Optional[str], Address: Optional[str], Rate: int, Deadband: int, OutputEnable: int) -> Any:
        """Configure scanning for a tag/agent slot.

        Args:
            Agent: Agent or "agent.slot".
            Slot: Slot name (ignored if Agent contains slot).
            Device: Device agent name (front-end).
            Address: Scan address (protocol-specific).
            Rate: Scan period in ms (use negative rate to unscan).
            Deadband: Deadband in units.
            OutputEnable: 1 to mark point as output, else 0.

        Returns:
            Any: Result object.
        """

class AdroitConfigOLE(AdroitConfig):    
    pass

adroitconfig: AdroitConfigOLE