import enum
from typing import List
[docs]class BaseBalancerEnum(enum.Enum):
"""
It's an enum that can be used to check if a value is in the enum,
and it can be used to get a list of all the values in the enum
"""
[docs] @classmethod
def has_value(cls, value) -> bool:
return value in cls._value2member_map_
[docs] @classmethod
def values(cls) -> List[str]:
return list(map(lambda c: c.value, cls)) # type: ignore