Ahenk/opt/ahenk/base/model/Response.py

72 lines
1.7 KiB
Python
Raw Normal View History

2016-03-30 17:34:10 +03:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Volkan Şahin <volkansah.in> <bm.volkansahin@gmail.com>
import datetime
2016-03-30 18:51:50 +03:00
class Response(object):
2016-03-30 17:34:10 +03:00
"""docstring for Plugin"""
2016-04-12 17:28:21 +03:00
def __init__(self, type, id, code=None, message=None, data=None, content_type=None, execution_id=None, policy_version=None):
2016-03-30 17:34:10 +03:00
self.type = type
self.id = id
self.code = code
self.message = message
2016-03-30 18:51:50 +03:00
self.data = data
self.content_type = content_type
2016-04-03 00:58:33 +03:00
self.execution_id = execution_id
2016-04-12 17:28:21 +03:00
self.policy_version = policy_version
2016-03-30 17:34:10 +03:00
self.timestamp = str(datetime.datetime.now().strftime("%d-%m-%Y %I:%M"))
def get_type(self):
return str(self.type)
def set_type(self, type):
self.type = type
def get_id(self):
return self.id
def set_id(self, id):
self.id = id
def get_code(self):
return str(self.code)
def set_code(self, code):
self.code = code
def get_message(self):
2016-04-12 17:28:21 +03:00
return self.message
2016-03-30 17:34:10 +03:00
def set_message(self, message):
self.message = message
def get_data(self):
2016-03-30 18:51:50 +03:00
return self.data
2016-03-30 17:34:10 +03:00
def set_data(self, data):
2016-03-30 18:51:50 +03:00
self.data = data
2016-03-30 17:34:10 +03:00
def get_content_type(self):
2016-03-30 18:51:50 +03:00
return self.content_type
2016-03-30 17:34:10 +03:00
def set_content_type(self, content_type):
2016-03-30 18:51:50 +03:00
self.content_type = content_type
2016-03-30 17:34:10 +03:00
def get_timestamp(self):
return self.timestamp
2016-04-03 00:58:33 +03:00
def get_execution_id(self):
return str(self.execution_id)
def set_execution_id(self, execution_id):
self.execution_id = execution_id
2016-04-12 17:28:21 +03:00
def get_policy_version(self):
return self.policy_version
def set_policy_version(self, policy_version):
self.policy_version = policy_version