fromJson method

  1. @override
UModEventViewDetailEvent fromJson(
  1. Map<String, dynamic> json
)

Implementation

@override
UModEventViewDetailEvent fromJson(Map<String, dynamic> json) {
  try {
    if (isModEventTakedown(json)) {
      return UModEventViewDetailEvent.modEventTakedown(
        data: const ModEventTakedownConverter().fromJson(json),
      );
    }
    if (isModEventReverseTakedown(json)) {
      return UModEventViewDetailEvent.modEventReverseTakedown(
        data: const ModEventReverseTakedownConverter().fromJson(json),
      );
    }
    if (isModEventComment(json)) {
      return UModEventViewDetailEvent.modEventComment(
        data: const ModEventCommentConverter().fromJson(json),
      );
    }
    if (isModEventReport(json)) {
      return UModEventViewDetailEvent.modEventReport(
        data: const ModEventReportConverter().fromJson(json),
      );
    }
    if (isModEventLabel(json)) {
      return UModEventViewDetailEvent.modEventLabel(
        data: const ModEventLabelConverter().fromJson(json),
      );
    }
    if (isModEventAcknowledge(json)) {
      return UModEventViewDetailEvent.modEventAcknowledge(
        data: const ModEventAcknowledgeConverter().fromJson(json),
      );
    }
    if (isModEventEscalate(json)) {
      return UModEventViewDetailEvent.modEventEscalate(
        data: const ModEventEscalateConverter().fromJson(json),
      );
    }
    if (isModEventMute(json)) {
      return UModEventViewDetailEvent.modEventMute(
        data: const ModEventMuteConverter().fromJson(json),
      );
    }
    if (isModEventUnmute(json)) {
      return UModEventViewDetailEvent.modEventUnmute(
        data: const ModEventUnmuteConverter().fromJson(json),
      );
    }
    if (isModEventMuteReporter(json)) {
      return UModEventViewDetailEvent.modEventMuteReporter(
        data: const ModEventMuteReporterConverter().fromJson(json),
      );
    }
    if (isModEventUnmuteReporter(json)) {
      return UModEventViewDetailEvent.modEventUnmuteReporter(
        data: const ModEventUnmuteReporterConverter().fromJson(json),
      );
    }
    if (isModEventEmail(json)) {
      return UModEventViewDetailEvent.modEventEmail(
        data: const ModEventEmailConverter().fromJson(json),
      );
    }
    if (isModEventResolveAppeal(json)) {
      return UModEventViewDetailEvent.modEventResolveAppeal(
        data: const ModEventResolveAppealConverter().fromJson(json),
      );
    }
    if (isModEventDivert(json)) {
      return UModEventViewDetailEvent.modEventDivert(
        data: const ModEventDivertConverter().fromJson(json),
      );
    }
    if (isModEventTag(json)) {
      return UModEventViewDetailEvent.modEventTag(
        data: const ModEventTagConverter().fromJson(json),
      );
    }

    return UModEventViewDetailEvent.unknown(data: json);
  } catch (_) {
    return UModEventViewDetailEvent.unknown(data: json);
  }
}