mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 16:01:15 -05:00
Making the new pinpoint client.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -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.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -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.")
|
||||||
|
|||||||
0
app/clients/pinpoint/__init__.py
Normal file
0
app/clients/pinpoint/__init__.py
Normal 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.")
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|||||||
Reference in New Issue
Block a user