toJson method

Map<String, Object> toJson()

Converts a EndpointConditions instance to JSON data.

Implementation

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

  final tempReady = ready;
  final tempServing = serving;
  final tempTerminating = terminating;

  if (tempReady != null) {
    jsonData['ready'] = tempReady;
  }

  if (tempServing != null) {
    jsonData['serving'] = tempServing;
  }

  if (tempTerminating != null) {
    jsonData['terminating'] = tempTerminating;
  }

  return jsonData;
}