fromJson method

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

Implementation

@override
USubscribeLabelsMessage fromJson(Map<String, dynamic> json) {
  try {
    if (isLabels(json)) {
      return USubscribeLabelsMessage.labels(
        data: const LabelsConverter().fromJson(json),
      );
    }
    if (isInfo(json)) {
      return USubscribeLabelsMessage.info(
        data: const InfoConverter().fromJson(json),
      );
    }

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