InlineQueryResultDocument constructor

const InlineQueryResultDocument({
  1. @JsonKey(name: 'id') required String id,
  2. @JsonKey(name: 'type') @Default(InlineQueryResultType.document) InlineQueryResultType type,
  3. @JsonKey(name: 'title') required String title,
  4. @JsonKey(name: 'document_url') required String documentUrl,
  5. @JsonKey(name: 'mime_type') required String mimeType,
  6. @JsonKey(name: 'caption') String? caption,
  7. @JsonKey(name: 'parse_mode') ParseMode? parseMode,
  8. @JsonKey(name: 'caption_entities') List<MessageEntity>? captionEntities,
  9. @JsonKey(name: 'description') String? description,
  10. @JsonKey(name: 'reply_markup') InlineKeyboardMarkup? replyMarkup,
  11. @JsonKey(name: 'input_message_content') @InputMessageContentConverter() InputMessageContent? inputMessageContent,
  12. @JsonKey(name: 'thumbnail_url') String? thumbnailUrl,
  13. @JsonKey(name: 'thumbnail_width') int? thumbnailWidth,
  14. @JsonKey(name: 'thumbnail_height') int? thumbnailHeight,
})

Constructs an InlineQueryResultDocument object

Implementation

const factory InlineQueryResultDocument({
  /// Unique identifier for this result, 1-64 Bytes
  @JsonKey(name: 'id') required String id,

  /// Type of the result, always [InlineQueryResultType.document]
  @JsonKey(name: 'type')
  @Default(InlineQueryResultType.document)
  InlineQueryResultType type,

  /// Title for the result
  @JsonKey(name: 'title') required String title,

  /// A valid URL for the file
  @JsonKey(name: 'document_url') required String documentUrl,

  /// MIME type of the content of the file, either "application/pdf" or
  /// "application/zip"
  @JsonKey(name: 'mime_type') required String mimeType,

  /// Optional. Caption of the document to be sent, 0-1024 characters after
  /// entities parsing
  @JsonKey(name: 'caption') String? caption,

  /// Optional. Mode for parsing entities in the document caption. See
  /// formatting options for more details.
  @JsonKey(name: 'parse_mode') ParseMode? parseMode,

  /// Optional. List of special entities that appear in the caption, which can
  /// be specified instead of parse_mode
  @JsonKey(name: 'caption_entities') List<MessageEntity>? captionEntities,

  /// Optional. Short description of the result
  @JsonKey(name: 'description') String? description,

  /// Optional. Inline keyboard attached to the message
  @JsonKey(name: 'reply_markup') InlineKeyboardMarkup? replyMarkup,

  /// Optional. Content of the message to be sent instead of the file
  @JsonKey(name: 'input_message_content')
  @InputMessageContentConverter()
  InputMessageContent? inputMessageContent,

  /// Optional. URL of the thumbnail (JPEG only) for the file
  @JsonKey(name: 'thumbnail_url') String? thumbnailUrl,

  /// Optional. Thumbnail width
  @JsonKey(name: 'thumbnail_width') int? thumbnailWidth,

  /// Optional. Thumbnail height
  @JsonKey(name: 'thumbnail_height') int? thumbnailHeight,
}) = _InlineQueryResultDocument;