deserialize method
void
deserialize(
- Map<String, dynamic>? json
)
override
Implementation
@override
void deserialize(Map<String, dynamic>? json) {
if (json == null) {
throw ApiException(400, 'Failed to deserialize Footnote data model.');
}
super.deserialize(json);
if (json.containsKey('Link')) {
link = ModelBase.createInstance<WordsApiLink>(
json['Link'] as Map<String, dynamic>);
} else {
link = null;
}
if (json.containsKey('NodeId')) {
nodeId = json['NodeId'] as String;
} else {
nodeId = null;
}
if (json.containsKey('Position')) {
position = ModelBase.createInstance<DocumentPosition>(
json['Position'] as Map<String, dynamic>);
} else {
position = null;
}
if (json.containsKey('FootnoteType')) {
switch (json['FootnoteType'] as String) {
case 'Footnote':
footnoteType = Footnote_FootnoteTypeEnum.footnote;
break;
case 'Endnote':
footnoteType = Footnote_FootnoteTypeEnum.endnote;
break;
default:
footnoteType = null;
break;
}
} else {
footnoteType = null;
}
if (json.containsKey('ReferenceMark')) {
referenceMark = json['ReferenceMark'] as String;
} else {
referenceMark = null;
}
if (json.containsKey('Text')) {
text = json['Text'] as String;
} else {
text = null;
}
if (json.containsKey('Content')) {
content = ModelBase.createInstance<StoryChildNodes>(
json['Content'] as Map<String, dynamic>);
} else {
content = null;
}
}