toJson method

Map<String, Object> toJson()

Converts a ReplicaSetSpec instance to JSON data.

Implementation

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

  final tempMinReadySeconds = minReadySeconds;
  final tempReplicas = replicas;
  final tempSelector = selector;
  final tempTemplate = template;

  if (tempMinReadySeconds != null) {
    jsonData['minReadySeconds'] = tempMinReadySeconds;
  }

  if (tempReplicas != null) {
    jsonData['replicas'] = tempReplicas;
  }

  jsonData['selector'] = tempSelector.toJson();

  if (tempTemplate != null) {
    jsonData['template'] = tempTemplate.toJson();
  }

  return jsonData;
}