Input$DirectMessageInput.fromJson constructor

Input$DirectMessageInput.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory Input$DirectMessageInput.fromJson(Map<String, dynamic> data) {
  final result$data = <String, dynamic>{};
  if (data.containsKey('text')) {
    final l$text = data['text'];
    result$data['text'] = (l$text as String?);
  }
  if (data.containsKey('gif')) {
    final l$gif = data['gif'];
    result$data['gif'] = (l$gif as String?);
  }
  if (data.containsKey('sticker')) {
    final l$sticker = data['sticker'];
    result$data['sticker'] = (l$sticker as String?);
  }
  if (data.containsKey('custom')) {
    final l$custom = data['custom'];
    result$data['custom'] = l$custom == null
        ? null
        : Input$CustomMessageInput.fromJson(
            (l$custom as Map<String, dynamic>));
  }
  if (data.containsKey('media')) {
    final l$media = data['media'];
    result$data['media'] = l$media == null
        ? null
        : Input$MessageMediaInput.fromJson((l$media as Map<String, dynamic>));
  }
  if (data.containsKey('location')) {
    final l$location = data['location'];
    result$data['location'] = l$location == null
        ? null
        : Input$LonLatInput.fromJson((l$location as Map<String, dynamic>));
  }
  if (data.containsKey('seenBy')) {
    final l$seenBy = data['seenBy'];
    result$data['seenBy'] =
        (l$seenBy as List<dynamic>?)?.map((e) => (e as String)).toList();
  }
  final l$receiver = data['receiver'];
  result$data['receiver'] = (l$receiver as String);
  if (data.containsKey('target')) {
    final l$target = data['target'];
    result$data['target'] = l$target == null
        ? null
        : Input$TargetACIInput.fromJson((l$target as Map<String, dynamic>));
  }
  if (data.containsKey('type')) {
    final l$type = data['type'];
    result$data['type'] = l$type == null
        ? null
        : fromJson$Enum$MessageGroupTypeEnum((l$type as String));
  }
  return Input$DirectMessageInput._(result$data);
}