toJson method

Map<String, Object> toJson()

Return a table representing the structure of the Json object that will be sent to the client to represent this response.

Implementation

Map<String, Object> toJson() {
  var jsonObject = <String, Object>{};
  jsonObject[ID] = id;
  jsonObject[METHOD] = method;
  if (params.isNotEmpty) {
    jsonObject[PARAMS] = params;
  }
  var clientRequestTime = this.clientRequestTime;
  if (clientRequestTime != null) {
    jsonObject[CLIENT_REQUEST_TIME] = clientRequestTime;
  }
  return jsonObject;
}