# Generated by sila2.code_generator; sila2.__version__: 0.12.2
from __future__ import annotations

from abc import ABC, abstractmethod
from typing import TYPE_CHECKING

from sila2.server import FeatureImplementationBase, MetadataDict

from .sessionmanagement_types import SessionCreate_Responses, SessionDelete_Responses

if TYPE_CHECKING:

    from ...server import Server


class SessionManagementBase(FeatureImplementationBase, ABC):
    parent_server: Server

    def __init__(self, parent_server: Server):
        """

        The features allows you to take exclusive access to the Opentron, this
        is required to run any other commands.

        """
        super().__init__(parent_server=parent_server)

    @abstractmethod
    def SessionCreate(self, *, metadata: MetadataDict) -> SessionCreate_Responses:
        """
        Creates a session to allow for controlling the Opentrons



        :param metadata: The SiLA Client Metadata attached to the call

        :return:

            - SessionToken: The session token used for running other commands



        """

    @abstractmethod
    def SessionDelete(self, SessionToken: str, *, metadata: MetadataDict) -> SessionDelete_Responses:
        """
        This stops the session and disables access through SiLA2



        :param SessionToken: The session token used for running other commands


        :param metadata: The SiLA Client Metadata attached to the call

        """
