toJson method
Converts a IngressSpec instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempDefaultBackend = defaultBackend;
final tempIngressClassName = ingressClassName;
final tempRules = rules;
final tempTls = tls;
if (tempDefaultBackend != null) {
jsonData['defaultBackend'] = tempDefaultBackend.toJson();
}
if (tempIngressClassName != null) {
jsonData['ingressClassName'] = tempIngressClassName;
}
if (tempRules != null) {
jsonData['rules'] =
tempRules.map((e) => e.toJson()).toList(growable: false);
}
if (tempTls != null) {
jsonData['tls'] = tempTls.map((e) => e.toJson()).toList(growable: false);
}
return jsonData;
}