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

59 lines
1.3 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-03-30 18:51:50 +03:00
def __init__(self, type, id, code=None, message=None, data=None, content_type=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-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):
return self.id
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