From 5975021c001d2dc46541f10b92b6844c83466ac9 Mon Sep 17 00:00:00 2001 From: Mauro Matteo Cascella Date: Thu, 14 Sep 2017 16:10:22 +0200 Subject: [PATCH] gophish/models: 'as_json' definition --- gophish/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gophish/models.py b/gophish/models.py index 1445e7a..dd1ea53 100644 --- a/gophish/models.py +++ b/gophish/models.py @@ -12,6 +12,10 @@ class Model(object): def __init__(self): self._valid_properties = {} + def as_json(self): + """ Returns a json representation of the resource """ + return _json.dumps(self.as_dict(), ensure_ascii=False) + def as_dict(self): """ Returns a dict representation of the resource """ result = {}