toJson method

Map<String, Object> toJson()

Converts a DaemonSetStatus instance to JSON data.

Implementation

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

  final tempCollisionCount = collisionCount;
  final tempConditions = conditions;
  final tempCurrentNumberScheduled = currentNumberScheduled;
  final tempDesiredNumberScheduled = desiredNumberScheduled;
  final tempNumberAvailable = numberAvailable;
  final tempNumberMisscheduled = numberMisscheduled;
  final tempNumberReady = numberReady;
  final tempNumberUnavailable = numberUnavailable;
  final tempObservedGeneration = observedGeneration;
  final tempUpdatedNumberScheduled = updatedNumberScheduled;

  if (tempCollisionCount != null) {
    jsonData['collisionCount'] = tempCollisionCount;
  }

  if (tempConditions != null) {
    jsonData['conditions'] =
        tempConditions.map((e) => e.toJson()).toList(growable: false);
  }

  jsonData['currentNumberScheduled'] = tempCurrentNumberScheduled;

  jsonData['desiredNumberScheduled'] = tempDesiredNumberScheduled;

  if (tempNumberAvailable != null) {
    jsonData['numberAvailable'] = tempNumberAvailable;
  }

  jsonData['numberMisscheduled'] = tempNumberMisscheduled;

  jsonData['numberReady'] = tempNumberReady;

  if (tempNumberUnavailable != null) {
    jsonData['numberUnavailable'] = tempNumberUnavailable;
  }

  if (tempObservedGeneration != null) {
    jsonData['observedGeneration'] = tempObservedGeneration;
  }

  if (tempUpdatedNumberScheduled != null) {
    jsonData['updatedNumberScheduled'] = tempUpdatedNumberScheduled;
  }

  return jsonData;
}