InlineQueryResultDocument.fromJson constructor
Constructs an InlineQueryResultDocument object from a JSON map
Implementation
factory InlineQueryResultDocument.fromJson(Map<String, dynamic> json) {
return InlineQueryResultDocument(
title: json['title'] as String,
documentUrl: json['document_url'] as String,
mimeType: json['mime_type'] as String,
id: json['id'] as String,
caption: json['caption'] as String?,
parseMode: json['parse_mode'] == null
? null
: ParseMode.fromJson(json['parse_mode'] as String),
captionEntities: (json['caption_entities'] as List<dynamic>?)
?.map((e) => MessageEntity.fromJson(e as Map<String, dynamic>))
.toList(),
description: json['description'] as String?,
replyMarkup: json['reply_markup'] == null
? null
: InlineKeyboardMarkup.fromJson(
json['reply_markup'] as Map<String, dynamic>,
),
inputMessageContent: json['input_message_content'] == null
? null
: InputMessageContent.fromJson(
json['input_message_content'] as Map<String, dynamic>,
),
thumbnailUrl: json['thumbnail_url'] as String?,
thumbnailWidth: json['thumbnail_width'] as int?,
thumbnailHeight: json['thumbnail_height'] as int?,
);
}