toJson method

Map<String, Object> toJson()

Converts a CSIStorageCapacity instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  if (apiVersion != null) {
    jsonData['apiVersion'] = apiVersion!;
  }
  if (capacity != null) {
    jsonData['capacity'] = capacity!;
  }
  if (kind != null) {
    jsonData['kind'] = kind!;
  }
  if (maximumVolumeSize != null) {
    jsonData['maximumVolumeSize'] = maximumVolumeSize!;
  }
  if (metadata != null) {
    jsonData['metadata'] = metadata!.toJson();
  }
  if (nodeTopology != null) {
    jsonData['nodeTopology'] = nodeTopology!.toJson();
  }
  jsonData['storageClassName'] = storageClassName;

  return jsonData;
}