-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathmodel.py
More file actions
37 lines (24 loc) · 997 Bytes
/
Copy pathmodel.py
File metadata and controls
37 lines (24 loc) · 997 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
28
29
30
31
32
33
34
35
36
37
from smsapi.models import ResultCollection
class SmsMFASendResult(ResultCollection):
def __init__(self, count, results, code, phone_number, from_):
super(SmsMFASendResult, self).__init__(count, results)
self.code = code
self.phone_number = phone_number
self.from_ = from_
@classmethod
def parse(cls, json_response, model):
code = json_response.get('code')
phone_number = json_response.get('phone_number')
from_ = json_response.get('from')
sms_list = [json_response]
collection = []
for sms in sms_list:
m = model.from_dict(sms)
collection.append(m)
return cls(1, collection, code=code, phone_number=phone_number, from_=from_)
class SmsMFAVerifyResult(ResultCollection):
def __init__(self, count, results):
super(SmsMFAVerifyResult, self).__init__(count, results)
@classmethod
def parse(cls, json_response, model):
return cls(0, [])