2024-01-04 09:00:41 -05:00
|
|
|
from abc import abstractmethod, abstractproperty
|
|
|
|
|
from typing import final
|
2023-12-29 18:11:55 -05:00
|
|
|
|
2021-03-10 13:55:06 +00:00
|
|
|
from app.clients import Client, ClientException
|
2016-02-15 16:01:14 +00:00
|
|
|
|
|
|
|
|
|
2016-09-22 17:18:05 +01:00
|
|
|
class SmsClientResponseException(ClientException):
|
2022-06-17 11:16:23 -07:00
|
|
|
"""
|
2016-09-22 17:18:05 +01:00
|
|
|
Base Exception for SmsClientsResponses
|
2022-06-17 11:16:23 -07:00
|
|
|
"""
|
2016-09-22 17:18:05 +01:00
|
|
|
|
|
|
|
|
def __init__(self, message):
|
|
|
|
|
self.message = message
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
2024-01-04 15:07:50 -05:00
|
|
|
return f"Message {self.message}"
|
2016-02-15 16:01:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class SmsClient(Client):
|
2022-06-17 11:16:23 -07:00
|
|
|
"""
|
2016-02-15 16:01:14 +00:00
|
|
|
Base Sms client for sending smss.
|
2022-06-17 11:16:23 -07:00
|
|
|
"""
|
|
|
|
|
|
2023-12-29 18:11:55 -05:00
|
|
|
@abstractmethod
|
2024-01-04 09:00:41 -05:00
|
|
|
def send_sms(self, *args, **kwargs):
|
2022-07-05 11:27:15 -07:00
|
|
|
raise NotImplementedError("TODO Need to implement.")
|
|
|
|
|
|
2024-01-04 09:00:41 -05:00
|
|
|
@abstractproperty
|
|
|
|
|
def name(self):
|
2022-06-17 11:16:23 -07:00
|
|
|
raise NotImplementedError("TODO Need to implement.")
|
|
|
|
|
|
2024-01-04 09:00:41 -05:00
|
|
|
@final
|
2022-06-17 11:16:23 -07:00
|
|
|
def get_name(self):
|
2024-01-04 09:00:41 -05:00
|
|
|
return self.name
|