Restructured how clients are implemented.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-01-04 09:00:41 -05:00
parent 3ff6d38660
commit d714ebcd5d
5 changed files with 19 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
from abc import abstractmethod
from abc import abstractmethod, abstractproperty
from typing import final
from app.clients import Client, ClientException
@@ -20,14 +21,14 @@ class SmsClient(Client):
Base Sms client for sending smss.
"""
@abstractmethod
def init_app(self, *args, **kwargs):
raise NotImplementedError("TODO Need to implement.")
@abstractmethod
def send_sms(self, *args, **kwargs):
raise NotImplementedError("TODO Need to implement.")
@abstractmethod
def get_name(self):
@abstractproperty
def name(self):
raise NotImplementedError("TODO Need to implement.")
@final
def get_name(self):
return self.name

View File

@@ -43,9 +43,6 @@ class AwsSnsClient(SmsClient):
def name(self):
return "sns"
def get_name(self):
return self.name
def _valid_sender_number(self, sender):
return sender and re.match(self._valid_sender_regex, sender)