InlineQueryResultCachedPhoto.fromJson constructor

InlineQueryResultCachedPhoto.fromJson(
  1. Map<String, dynamic> json
)

Constructs an InlineQueryResultCachedPhoto object from a JSON map

Implementation

factory InlineQueryResultCachedPhoto.fromJson(Map<String, dynamic> json) {
  return InlineQueryResultCachedPhoto(
    id: json['id'] as String,
    photoFileId: json['photo_file_id'] as String,
    title: json['title'] as String?,
    description: json['description'] as String?,
    caption: json['caption'] as String?,
    parseMode: json['parse_mode'] == null
        ? null
        : ParseMode.fromJson(json['parse_mode'] as String),
    captionEntities: json['caption_entities'] == null
        ? null
        : (json['caption_entities'] as List<dynamic>?)
            ?.map((e) => MessageEntity.fromJson(e as Map<String, dynamic>))
            .toList(),
    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>,
          ),
    showCaptionAboveMedia: json['show_caption_above_media'],
  );
}