toJson method

Map<String, Object> toJson()

Converts a ScaleStatus instance to JSON data.

Implementation

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

  final tempReplicas = replicas;
  final tempSelector = selector;

  jsonData['replicas'] = tempReplicas;

  if (tempSelector != null) {
    jsonData['selector'] = tempSelector;
  }

  return jsonData;
}