2016-03-16 17:26:25 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
|
|
|
|
from base.model.Plugin import Plugin
|
|
|
|
import json
|
|
|
|
|
|
|
|
class Profile(object):
|
|
|
|
"""docstring for Profile"""
|
|
|
|
def __init__(self,message):
|
|
|
|
self.profile = message
|
|
|
|
|
|
|
|
@property
|
|
|
|
def id(self):
|
|
|
|
return self.profile['id']
|
|
|
|
|
2016-03-18 18:20:14 +02:00
|
|
|
@property
|
|
|
|
def create_date(self):
|
|
|
|
return self.profile['createdate']
|
|
|
|
|
|
|
|
@property
|
|
|
|
def modify_date(self):
|
|
|
|
return self.profile['modifydate']
|
|
|
|
|
2016-03-16 17:26:25 +02:00
|
|
|
@property
|
2016-03-17 17:55:27 +02:00
|
|
|
def label(self):
|
|
|
|
return self.profile['label']
|
2016-03-16 17:26:25 +02:00
|
|
|
|
|
|
|
@property
|
2016-03-17 17:55:27 +02:00
|
|
|
def description(self):
|
|
|
|
return self.profile['description']
|
|
|
|
|
|
|
|
@property
|
2016-03-18 18:20:14 +02:00
|
|
|
def overridable(self):
|
|
|
|
return self.profile['overridable']
|
2016-03-17 17:55:27 +02:00
|
|
|
|
|
|
|
@property
|
2016-03-18 18:20:14 +02:00
|
|
|
def active(self):
|
|
|
|
return self.profile['active']
|
2016-03-17 17:55:27 +02:00
|
|
|
|
|
|
|
@property
|
2016-03-18 18:20:14 +02:00
|
|
|
def deleted(self):
|
|
|
|
return self.profile['deleted']
|
2016-03-17 17:55:27 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def profile_data(self):
|
2016-03-18 18:20:14 +02:00
|
|
|
return self.profile['profileData']
|
2016-03-16 17:26:25 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def plugin(self):
|
|
|
|
return Plugin(self.profile['plugin'])
|
2016-03-21 12:00:45 +02:00
|
|
|
|
|
|
|
def to_string(self):
|
|
|
|
return str(self.profile)
|
|
|
|
|
|
|
|
def to_json(self):
|
|
|
|
return json.load(self.profile)
|
|
|
|
|