-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotif_interface.py
More file actions
27 lines (19 loc) · 858 Bytes
/
notif_interface.py
File metadata and controls
27 lines (19 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from __future__ import annotations
"""
The Notifier interface declares the abstract operation 'notify' and 'validate_data' that all concrete notifiers
must implement.
All concrete instances will implement notify() for their use case, for instance ...
- SmsNotifier must send a sms when notify() is called upon it.
- PostNotifier must send a POST req to API endpoint with user's data payload when notify() is called upon it.
All concrete instances will implement validate_date() to validate the required param fot instance ...
- SmsNotifier must not have name and phone fields as null.
"""
# Importing dependencies.
from abc import ABC, abstractmethod, abstractproperty
class Notifier(ABC):
@abstractmethod
def notify(self) -> str:
pass
@abstractmethod
def validate_data(self) -> bool:
pass