toJson method

Map<String, Object> toJson()

Converts a ReplicationControllerSpec 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;
  }

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

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

  return jsonData;
}