toJson method

Map<String, Object> toJson()

Converts a ControllerRevision instance to JSON data.

Implementation

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

  final tempApiVersion = apiVersion;
  final tempData = data;
  final tempKind = kind;
  final tempMetadata = metadata;
  final tempRevision = revision;

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

  if (tempData != null) {
    jsonData['data'] = tempData.toJson();
  }

  if (tempKind != null) {
    jsonData['kind'] = tempKind;
  }

  if (tempMetadata != null) {
    jsonData['metadata'] = tempMetadata.toJson();
  }

  jsonData['revision'] = tempRevision;

  return jsonData;
}