toJson method

Map<String, Object> toJson()

Converts a ResourceClaimSpec instance to JSON data.

Implementation

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

  final tempAllocationMode = allocationMode;
  final tempParametersRef = parametersRef;
  final tempResourceClassName = resourceClassName;

  if (tempAllocationMode != null) {
    jsonData['allocationMode'] = tempAllocationMode;
  }

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

  jsonData['resourceClassName'] = tempResourceClassName;

  return jsonData;
}