mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-07-20 20:16:57 +00:00
32 lines
978 B
Python
32 lines
978 B
Python
|
"""
|
||
|
Peer Job
|
||
|
"""
|
||
|
from datetime import datetime
|
||
|
class PeerJob:
|
||
|
def __init__(self, JobID: str, Configuration: str, Peer: str,
|
||
|
Field: str, Operator: str, Value: str, CreationDate: datetime, ExpireDate: datetime, Action: str):
|
||
|
self.Action = Action
|
||
|
self.ExpireDate = ExpireDate
|
||
|
self.CreationDate = CreationDate
|
||
|
self.Value = Value
|
||
|
self.Operator = Operator
|
||
|
self.Field = Field
|
||
|
self.Configuration = Configuration
|
||
|
self.Peer = Peer
|
||
|
self.JobID = JobID
|
||
|
|
||
|
def toJson(self):
|
||
|
return {
|
||
|
"JobID": self.JobID,
|
||
|
"Configuration": self.Configuration,
|
||
|
"Peer": self.Peer,
|
||
|
"Field": self.Field,
|
||
|
"Operator": self.Operator,
|
||
|
"Value": self.Value,
|
||
|
"CreationDate": self.CreationDate,
|
||
|
"ExpireDate": self.ExpireDate,
|
||
|
"Action": self.Action
|
||
|
}
|
||
|
|
||
|
def __dict__(self):
|
||
|
return self.toJson()
|