# Path: isserviceup/notifiers/notifier.py
# class Notifier(object):
# 
#     def notify(self, service, old_status, new_status):
#         raise NotImplemented()


import requests
from enum import Enum
from decouple import config
from isserviceup.notifiers.notifier import Notifier
        from isserviceup.services.models.service import Status


class CachetStatus(Enum):
    ok = 1
    minor = 2
    major = 3
    critical = 4

    @staticmethod
    def get_cachet_status(status):
        status_map = {
            Status.ok: CachetStatus.ok,
            Status.maintenance: CachetStatus.minor,
            Status.minor: CachetStatus.minor,
            Status.major: CachetStatus.major,
            Status.critical: CachetStatus.critical,
            Status.unavailable: CachetStatus.critical,
        }
        status = status and Status[status]
        return (status_map[status].value if status in status_map
                else CachetStatus.critical.value)



# Path: isserviceup/notifiers/notifier.py
# class Notifier(object):
# 
#     def notify(self, service, old_status, new_status):
#         raise NotImplemented()


# Path: isserviceup/notifiers/cachet.py
import requests
from enum import Enum
from decouple import config
from isserviceup.notifiers.notifier import Notifier
        from isserviceup.services.models.service import Status



class CachetStatus(Enum):
    ok = 1
    minor = 2
    major = 3
    critical = 4

    @staticmethod
    def get_cachet_status(status):
        status_map = {
            Status.ok: CachetStatus.ok,
            Status.maintenance: CachetStatus.minor,
            Status.minor: CachetStatus.minor,
            Status.major: CachetStatus.major,
            Status.critical: CachetStatus.critical,
            Status.unavailable: CachetStatus.critical,
        }
        status = status and Status[status]
        return (status_map[status].value if status in status_map
                else CachetStatus.critical.value)



class Cachet(Notifier):