toJson method
Converts a NamedRuleWithOperations instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempApiGroups = apiGroups;
final tempApiVersions = apiVersions;
final tempOperations = operations;
final tempResourceNames = resourceNames;
final tempResources = resources;
final tempScope = scope;
if (tempApiGroups != null) {
jsonData['apiGroups'] = tempApiGroups;
}
if (tempApiVersions != null) {
jsonData['apiVersions'] = tempApiVersions;
}
if (tempOperations != null) {
jsonData['operations'] = tempOperations;
}
if (tempResourceNames != null) {
jsonData['resourceNames'] = tempResourceNames;
}
if (tempResources != null) {
jsonData['resources'] = tempResources;
}
if (tempScope != null) {
jsonData['scope'] = tempScope;
}
return jsonData;
}