Making the new pinpoint client.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2023-12-29 18:11:55 -05:00
parent f92417d81d
commit 3ff6d38660
5 changed files with 14 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
from typing import Protocol
from botocore.config import Config from botocore.config import Config
AWS_CLIENT_CONFIG = Config( AWS_CLIENT_CONFIG = Config(
@@ -22,7 +24,7 @@ class ClientException(Exception):
pass pass
class Client(object): class Client(Protocol):
""" """
Base client for sending notifications. Base client for sending notifications.
""" """

View File

@@ -1,3 +1,5 @@
from abc import abstractmethod, abstractproperty
from app.clients import Client, ClientException from app.clients import Client, ClientException
@@ -27,9 +29,10 @@ class EmailClient(Client):
Base Email client for sending emails. Base Email client for sending emails.
""" """
@abstractmethod
def send_email(self, *args, **kwargs): def send_email(self, *args, **kwargs):
raise NotImplementedError("TODO Need to implement.") raise NotImplementedError("TODO Need to implement.")
@property @abstractproperty
def name(self): def name(self):
raise NotImplementedError("TODO Need to implement.") raise NotImplementedError("TODO Need to implement.")

View File

View File

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

View File

@@ -27,7 +27,8 @@ def upgrade():
# select_by_val = service_id # select_by_val = service_id
input_params = {"service_id": service_id} input_params = {"service_id": service_id}
conn.execute( conn.execute(
text("update services set name='Notify.gov' where id =:service_id"), input_params text("update services set name='Notify.gov' where id =:service_id"),
input_params,
) )
# table_name = 'services_history' # table_name = 'services_history'