-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMailBox.py
More file actions
48 lines (41 loc) · 1.33 KB
/
MailBox.py
File metadata and controls
48 lines (41 loc) · 1.33 KB
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
38
39
40
41
42
43
44
45
46
47
48
class MailBox:
def __init__(self, name="", email="", password=""):
if name and email and password:
self.name = name
self.email = email
self.password = password
def to_string(self):
return "MailBox: "+self.name+" "+self.email
def to_create(self):
data = {
"name": self.name,
"email": self.email,
"passwordPlaintext": self.password,
"disabled": False,
"superAdmin": False,
"redirectTo": [],
"referenceId": self.email
}
return data
def to_patch(self,new_password):
data = {
"name": self.name,
"passwordPlaintext": new_password,
"disabled": False,
"superAdmin": False,
"referenceId": self.email
}
return data
def to_update_quota(self, storageLimit, countLimit):
strStorage = str(storageLimit)[:-2]
data = {
"storageLimit": strStorage,
"countLimit": countLimit
}
return data
def from_json(self,data_json):
self.name = data_json["name"]
self.email = data_json["address"]
self.disabled = data_json["disabled"]
self.created = data_json["created"]
self.updated = data_json["updated"]