toJson method
Converts a SecurityContext instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAllowPrivilegeEscalation = allowPrivilegeEscalation;
final tempCapabilities = capabilities;
final tempPrivileged = privileged;
final tempProcMount = procMount;
final tempReadOnlyRootFilesystem = readOnlyRootFilesystem;
final tempRunAsGroup = runAsGroup;
final tempRunAsNonRoot = runAsNonRoot;
final tempRunAsUser = runAsUser;
final tempSeLinuxOptions = seLinuxOptions;
final tempSeccompProfile = seccompProfile;
final tempWindowsOptions = windowsOptions;
if (tempAllowPrivilegeEscalation != null) {
jsonData['allowPrivilegeEscalation'] = tempAllowPrivilegeEscalation;
}
if (tempCapabilities != null) {
jsonData['capabilities'] = tempCapabilities.toJson();
}
if (tempPrivileged != null) {
jsonData['privileged'] = tempPrivileged;
}
if (tempProcMount != null) {
jsonData['procMount'] = tempProcMount;
}
if (tempReadOnlyRootFilesystem != null) {
jsonData['readOnlyRootFilesystem'] = tempReadOnlyRootFilesystem;
}
if (tempRunAsGroup != null) {
jsonData['runAsGroup'] = tempRunAsGroup;
}
if (tempRunAsNonRoot != null) {
jsonData['runAsNonRoot'] = tempRunAsNonRoot;
}
if (tempRunAsUser != null) {
jsonData['runAsUser'] = tempRunAsUser;
}
if (tempSeLinuxOptions != null) {
jsonData['seLinuxOptions'] = tempSeLinuxOptions.toJson();
}
if (tempSeccompProfile != null) {
jsonData['seccompProfile'] = tempSeccompProfile.toJson();
}
if (tempWindowsOptions != null) {
jsonData['windowsOptions'] = tempWindowsOptions.toJson();
}
return jsonData;
}