toJson method
Converts a ConfigMap instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempApiVersion = apiVersion;
final tempBinaryData = binaryData;
final tempData = data;
final tempImmutable = immutable;
final tempKind = kind;
final tempMetadata = metadata;
if (tempApiVersion != null) {
jsonData['apiVersion'] = tempApiVersion;
}
if (tempBinaryData != null) {
jsonData['binaryData'] = tempBinaryData;
}
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();
}
return jsonData;
}