toJson method

Map<String, Object> toJson()

Converts a Toleration instance to JSON data.

Implementation

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

  if (effect != null) {
    jsonData['effect'] = effect!;
  }
  if (key != null) {
    jsonData['key'] = key!;
  }
  if (operator != null) {
    jsonData['operator'] = operator!;
  }
  if (tolerationSeconds != null) {
    jsonData['tolerationSeconds'] = tolerationSeconds!;
  }
  if (value != null) {
    jsonData['value'] = value!;
  }

  return jsonData;
}