2016-03-16 17:26:25 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
|
|
|
|
import json
|
|
|
|
|
2016-03-23 17:15:27 +02:00
|
|
|
from base.model.Plugin import Plugin
|
|
|
|
|
|
|
|
|
2016-03-16 17:26:25 +02:00
|
|
|
class Profile(object):
|
|
|
|
"""docstring for Profile"""
|
2016-03-23 17:15:27 +02:00
|
|
|
|
|
|
|
def __init__(self, message):
|
2016-03-16 17:26:25 +02:00
|
|
|
self.profile = message
|
|
|
|
|
|
|
|
@property
|
|
|
|
def id(self):
|
|
|
|
return self.profile['id']
|
|
|
|
|
2016-03-18 18:20:14 +02:00
|
|
|
@property
|
|
|
|
def create_date(self):
|
2016-03-24 17:55:23 +02:00
|
|
|
return self.profile['createDate']
|
2016-03-18 18:20:14 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def modify_date(self):
|
2016-03-24 17:55:23 +02:00
|
|
|
return self.profile['modifyDate']
|
2016-03-18 18:20:14 +02:00
|
|
|
|
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)
|
2016-03-29 11:52:18 +03:00
|
|
|
|
|
|
|
@property
|
|
|
|
def obj_name(self):
|
|
|
|
return "PROFILE"
|