import abc
import time


class Callback:

    @abc.abstractmethod
    def on_success(self, item):
        return

    @abc.abstractmethod
    def on_failure(self, item):
        return

    @abc.abstractmethod
    def on_error(self, item, attempt, max_attempts):
        return


class STDOUTCallback(Callback):

    def on_success(self, item):
        print("ITEM FOR SALE!")
        print(f"{item.get_name()}")
        print(f"{item.get_url()}")

    def on_failure(self, item):
        print(f"{item.get_name()} is still not available")
        return

    def on_error(self, item, attempt, max_attempts):
        pass


class WindowsBeepCallback:

    def __init__(self, beep_freq: "hertz" = 440, duration: "milliseconds" = 1000, amount = 1, wait: "seconds" = 1):
        self._beep_freq = beep_freq
        self._duration = duration
        self._amount = amount
        self._wait = wait

    def __call__(self, item):
        import winsound
        print("ITEM FOR SALE!")
        for _ in range(self._amount):
            winsound.Beep(self._beep_freq, self._duration)
            time.sleep(self._wait)


class SMSCallback:

    def __init__(self, phone_number):
        self._phone_number = phone_number

    def __call__(self, item):
        return