toJsonForProtocol method
Returns a JSON structure of the model, optimized for Protocol communication.
Implementation
@override
Map<String, dynamic> toJsonForProtocol() {
return {
if (id != null) 'id': id,
'serverId': serverId,
'time': time.toJson(),
if (module != null) 'module': module,
if (endpoint != null) 'endpoint': endpoint,
if (method != null) 'method': method,
if (duration != null) 'duration': duration,
if (numQueries != null) 'numQueries': numQueries,
if (slow != null) 'slow': slow,
if (error != null) 'error': error,
if (stackTrace != null) 'stackTrace': stackTrace,
if (authenticatedUserId != null)
'authenticatedUserId': authenticatedUserId,
if (isOpen != null) 'isOpen': isOpen,
'touched': touched.toJson(),
};
}