toJson method
Converts a Secret instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempApiVersion = apiVersion;
final tempData = data;
final tempImmutable = immutable;
final tempKind = kind;
final tempMetadata = metadata;
final tempStringData = stringData;
final tempType = type;
if (tempApiVersion != null) {
jsonData['apiVersion'] = tempApiVersion;
}
if (tempData != null) {
jsonData['data'] = tempData;
}
if (tempImmutable != null) {
jsonData['immutable'] = tempImmutable;
}
if (tempKind != null) {
jsonData['kind'] = tempKind;
}
if (tempMetadata != null) {
jsonData['metadata'] = tempMetadata.toJson();
}
if (tempStringData != null) {
jsonData['stringData'] = tempStringData;
}
if (tempType != null) {
jsonData['type'] = tempType;
}
return jsonData;
}