toJson method

Map<String, Object> toJson()

Converts a GlusterfsPersistentVolumeSource instance to JSON data.

Implementation

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

  final tempEndpoints = endpoints;
  final tempEndpointsNamespace = endpointsNamespace;
  final tempPath = path;
  final tempReadOnly = readOnly;

  jsonData['endpoints'] = tempEndpoints;

  if (tempEndpointsNamespace != null) {
    jsonData['endpointsNamespace'] = tempEndpointsNamespace;
  }

  jsonData['path'] = tempPath;

  if (tempReadOnly != null) {
    jsonData['readOnly'] = tempReadOnly;
  }

  return jsonData;
}