toJson method
Converts a ClusterCIDRSpec instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempIpv4 = ipv4;
final tempIpv6 = ipv6;
final tempNodeSelector = nodeSelector;
final tempPerNodeHostBits = perNodeHostBits;
if (tempIpv4 != null) {
jsonData['ipv4'] = tempIpv4;
}
if (tempIpv6 != null) {
jsonData['ipv6'] = tempIpv6;
}
if (tempNodeSelector != null) {
jsonData['nodeSelector'] = tempNodeSelector.toJson();
}
jsonData['perNodeHostBits'] = tempPerNodeHostBits;
return jsonData;
}