deserialize method

  1. @override
void deserialize(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
void deserialize(Map<String, dynamic>? json) {
  if (json == null) {
    throw ApiException(
        400, 'Failed to deserialize FootnoteUpdate data model.');
  }

  super.deserialize(json);
  if (json.containsKey('Position')) {
    position = ModelBase.createInstance<Position>(
        json['Position'] as Map<String, dynamic>);
  } else {
    position = null;
  }

  if (json.containsKey('FootnoteType')) {
    switch (json['FootnoteType'] as String) {
      case 'Footnote':
        footnoteType = FootnoteBase_FootnoteTypeEnum.footnote;
        break;
      case 'Endnote':
        footnoteType = FootnoteBase_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;
  }
}