from empire import *
from abc import ABC, abstractmethod

from empire.aws.ssm.structs.get_parameter_response import GetParameterResponse
from empire.aws.ssm.enums.parameter_types import ParameterTypes
from empire.aws.ssm.enums.parameter_data_types import ParameterDataTypes
from empire.data_structures.map.ests_map import ESTSMap


class AbstractSSM(ABC):
    CACHE: ESTSMap[str, GetParameterResponse] = {}

    @staticmethod
    @abstractmethod
    def get_parameter(parameter_name: str, decrypt: bool = False) -> GetParameterResponse:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def cached_get_parameter(parameter_name: str, decrypt: bool = False) -> GetParameterResponse:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def put_parameter(parameter_name: str, value: Any, parameter_type: str = ParameterTypes.STRING, parameter_data_type: str = ParameterDataTypes.TEXT,
                      description: str = None, **kwargs) -> bool:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def cached_put_parameter(parameter_name: str, value: Any, parameter_type: str = ParameterTypes.STRING, parameter_data_type: str = ParameterDataTypes.TEXT,
                             description: str = None, **kwargs) -> bool:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def list_parameters() -> List[GetParameterResponse]:
        raise NotImplementedError()

from empire import *
from abc import ABC, abstractmethod

from empire.aws.ssm.structs.get_parameter_response import GetParameterResponse
from empire.aws.ssm.enums.parameter_types import ParameterTypes
from empire.aws.ssm.enums.parameter_data_types import ParameterDataTypes
from empire.data_structures.map.ests_map import ESTSMap


class AbstractSSM(ABC):
    CACHE: ESTSMap[str, GetParameterResponse] = {}

    @staticmethod
    @abstractmethod
    def get_parameter(parameter_name: str, decrypt: bool = False) -> GetParameterResponse:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def cached_get_parameter(parameter_name: str, decrypt: bool = False) -> GetParameterResponse:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def put_parameter(parameter_name: str, value: Any, parameter_type: str = ParameterTypes.STRING, parameter_data_type: str = ParameterDataTypes.TEXT,
                      description: str = None, **kwargs) -> bool:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def cached_put_parameter(parameter_name: str, value: Any, parameter_type: str = ParameterTypes.STRING, parameter_data_type: str = ParameterDataTypes.TEXT,
                             description: str = None, **kwargs) -> bool:
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def list_parameters() -> List[GetParameterResponse]:
        raise NotImplementedError()
