-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPyToastSMS.py
36 lines (27 loc) · 1.11 KB
/
PyToastSMS.py
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
28
29
30
31
32
33
34
35
36
from typing import List
import enforce
from config import secret
from src import sender
from src.sender.mms import MMS
from src.sender.sms import SMS
class ToastSMSManager(object):
"""
PyToastSms
"""
_appKey = secret.get('app_key')
@enforce.runtime_validation
def __init__(self, app_key: str = None):
super(ToastSMSManager, self).__init__()
self._appKey: str = app_key or self._appKey
@enforce.runtime_validation
def send_sms(self, send_no: str, recipient_list: List[dict], body: str, **kwargs):
return SMS.Request(send_no, recipient_list, body, **kwargs).send_sms()
@enforce.runtime_validation
def send_mms(self, send_no: str, recipient_list: List[dict], title: str, body: str, **kwargs):
return MMS.Request(send_no, recipient_list, title, body, **kwargs).send_mms()
@classmethod
def list_send_nos(cls):
return sender.list_send_nos()
@classmethod
def list_sent_sms(cls, requestId: str = None, startRequestDate: str = None, endRequestDate: str = None):
return SMS.list_sent_sms(requestId, startRequestDate, endRequestDate)