toJson method

Map<String, Object> toJson()

Converts a ResourceClass instance to JSON data.

Implementation

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

  final tempApiVersion = apiVersion;
  final tempDriverName = driverName;
  final tempKind = kind;
  final tempMetadata = metadata;
  final tempParametersRef = parametersRef;
  final tempSuitableNodes = suitableNodes;

  if (tempApiVersion != null) {
    jsonData['apiVersion'] = tempApiVersion;
  }

  jsonData['driverName'] = tempDriverName;

  if (tempKind != null) {
    jsonData['kind'] = tempKind;
  }

  if (tempMetadata != null) {
    jsonData['metadata'] = tempMetadata.toJson();
  }

  if (tempParametersRef != null) {
    jsonData['parametersRef'] = tempParametersRef.toJson();
  }

  if (tempSuitableNodes != null) {
    jsonData['suitableNodes'] = tempSuitableNodes.toJson();
  }

  return jsonData;
}