toJson method

Map<String, Object> toJson()

Converts a ResourceQuotaSpec instance to JSON data.

Implementation

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

  final tempHard = hard;
  final tempScopeSelector = scopeSelector;
  final tempScopes = scopes;

  if (tempHard != null) {
    jsonData['hard'] = tempHard;
  }

  if (tempScopeSelector != null) {
    jsonData['scopeSelector'] = tempScopeSelector.toJson();
  }

  if (tempScopes != null) {
    jsonData['scopes'] = tempScopes;
  }

  return jsonData;
}