toJson method
Converts a ResourceAttributes instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempGroup = group;
final tempName = name;
final tempNamespace = namespace;
final tempResource = resource;
final tempSubresource = subresource;
final tempVerb = verb;
final tempVersion = version;
if (tempGroup != null) {
jsonData['group'] = tempGroup;
}
if (tempName != null) {
jsonData['name'] = tempName;
}
if (tempNamespace != null) {
jsonData['namespace'] = tempNamespace;
}
if (tempResource != null) {
jsonData['resource'] = tempResource;
}
if (tempSubresource != null) {
jsonData['subresource'] = tempSubresource;
}
if (tempVerb != null) {
jsonData['verb'] = tempVerb;
}
if (tempVersion != null) {
jsonData['version'] = tempVersion;
}
return jsonData;
}