toJson method
Converts a NetworkPolicyPeer instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempIpBlock = ipBlock;
final tempNamespaceSelector = namespaceSelector;
final tempPodSelector = podSelector;
if (tempIpBlock != null) {
jsonData['ipBlock'] = tempIpBlock.toJson();
}
if (tempNamespaceSelector != null) {
jsonData['namespaceSelector'] = tempNamespaceSelector.toJson();
}
if (tempPodSelector != null) {
jsonData['podSelector'] = tempPodSelector.toJson();
}
return jsonData;
}