Files
notifications-api/app/clients/sms/__init__.py
T

36 lines
768 B
Python
Raw Normal View History

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
class SmsClientResponseException(ClientException):
2022-06-17 11:16:23 -07:00
"""
Base Exception for SmsClientsResponses
2022-06-17 11:16:23 -07:00
"""
def __init__(self, message):
super().__init__(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
"""
2016-02-15 16:01:14 +00:00
2023-12-29 18:11:55 -05:00
@abstractmethod
2022-06-17 11:16:23 -07:00
def send_sms(self, *args, **kwargs):
raise NotImplementedError("TODO Need to implement.")
2022-03-25 13:05:23 +00:00
2024-01-04 09:00:41 -05:00
@abstractproperty
def name(self):
2022-10-14 14:45:27 +00:00
raise NotImplementedError("TODO Need to implement.")
2024-01-04 09:00:41 -05:00
@final
def get_name(self):
return self.name