toJson method

Map<String, Object> toJson()

Converts a ManagedFieldsEntry instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempApiVersion = apiVersion;
  final tempFieldsType = fieldsType;
  final tempFieldsV1 = fieldsV1;
  final tempManager = manager;
  final tempOperation = operation;
  final tempSubresource = subresource;
  final tempTime = time;

  if (tempApiVersion != null) {
    jsonData['apiVersion'] = tempApiVersion;
  }

  if (tempFieldsType != null) {
    jsonData['fieldsType'] = tempFieldsType;
  }

  if (tempFieldsV1 != null) {
    jsonData['fieldsV1'] = tempFieldsV1.toJson();
  }

  if (tempManager != null) {
    jsonData['manager'] = tempManager;
  }

  if (tempOperation != null) {
    jsonData['operation'] = tempOperation;
  }

  if (tempSubresource != null) {
    jsonData['subresource'] = tempSubresource;
  }

  if (tempTime != null) {
    jsonData['time'] = tempTime;
  }

  return jsonData;
}