toJson method

Map<String, Object> toJson()

Converts a Eviction instance to JSON data.

Implementation

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

  final tempApiVersion = apiVersion;
  final tempDeleteOptions = deleteOptions;
  final tempKind = kind;
  final tempMetadata = metadata;

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

  if (tempDeleteOptions != null) {
    jsonData['deleteOptions'] = tempDeleteOptions.toJson();
  }

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

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

  return jsonData;
}