code: def to_json(self):
      data = {"success": self.success, "error": self.error_message}
      if self.redirect_url is not None:
          data["redirect_url"] = self.redirect_url
      return data
  
file_path: mindsdb/mindsdb/integrations/libs/response.py
imports: from pandas import DataFrame
  from mindsdb.utilities import log
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from mindsdb_sql.parser.ast import ASTNode
label_desc: Use image node_id 2 for calling the HandlerStatusResponse obj's underlying member method code with example usage: obj.to_json() and returns: data