toJson method
Converts a NetworkPolicyEgressRule instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempPorts = ports;
final tempTo = to;
if (tempPorts != null) {
jsonData['ports'] =
tempPorts.map((e) => e.toJson()).toList(growable: false);
}
if (tempTo != null) {
jsonData['to'] = tempTo.map((e) => e.toJson()).toList(growable: false);
}
return jsonData;
}