toJsonForProtocol method

  1. @override
Map<String, dynamic> toJsonForProtocol()
override

Returns a JSON structure of the model, optimized for Protocol communication.

Implementation

@override
Map<String, dynamic> toJsonForProtocol() {
  return {
    'name': name,
    if (dartName != null) 'dartName': dartName,
    if (module != null) 'module': module,
    'schema': schema,
    if (tableSpace != null) 'tableSpace': tableSpace,
    'columns': columns.toJson(valueToJson: (v) => v.toJsonForProtocol()),
    'foreignKeys':
        foreignKeys.toJson(valueToJson: (v) => v.toJsonForProtocol()),
    'indexes': indexes.toJson(valueToJson: (v) => v.toJsonForProtocol()),
    if (managed != null) 'managed': managed,
  };
}