toJson method

Map<String, Object> toJson()

Converts a ControllerRevisionList instance to JSON data.

Implementation

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

  final tempApiVersion = apiVersion;
  final tempItems = items;
  final tempKind = kind;
  final tempMetadata = metadata;

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

  jsonData['items'] =
      tempItems.map((e) => e.toJson()).toList(growable: false);

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

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

  return jsonData;
}