def to_json(self):
if self.subreference is not None:<EOL><INDENT>return {<EOL>"<STR_LIT:source>": self.objectId,<EOL>"<STR_LIT>": {<EOL>"<STR_LIT:type>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:value>": self.subreference<EOL>}<EOL>}<EOL><DEDENT>else:<EOL><INDENT>return {"<STR_LIT:source>": self.objectId}<EOL><DEDENT>
Method to call to get a serializable object for json.dump or jsonify based on the target

        :return: dict