toJson method
Converts a CSIStorageCapacity instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempApiVersion = apiVersion;
final tempCapacity = capacity;
final tempKind = kind;
final tempMaximumVolumeSize = maximumVolumeSize;
final tempMetadata = metadata;
final tempNodeTopology = nodeTopology;
final tempStorageClassName = storageClassName;
if (tempApiVersion != null) {
jsonData['apiVersion'] = tempApiVersion;
}
if (tempCapacity != null) {
jsonData['capacity'] = tempCapacity;
}
if (tempKind != null) {
jsonData['kind'] = tempKind;
}
if (tempMaximumVolumeSize != null) {
jsonData['maximumVolumeSize'] = tempMaximumVolumeSize;
}
if (tempMetadata != null) {
jsonData['metadata'] = tempMetadata.toJson();
}
if (tempNodeTopology != null) {
jsonData['nodeTopology'] = tempNodeTopology.toJson();
}
jsonData['storageClassName'] = tempStorageClassName;
return jsonData;
}