WidgetQuery constructor

const WidgetQuery({
  1. @JsonKey.new(name: 'id') required String id,
  2. @JsonKey.new(name: 'from') required User from,
  3. @JsonKey.new(name: 'chat_instance') required String chatInstance,
  4. @JsonKey.new(name: 'type') required WidgetQueryType type,
  5. @JsonKey.new(name: 'data') required String data,
  6. @JsonKey.new(name: 'chat') Chat? chat,
  7. @JsonKey.new(name: 'message_id') int? messageId,
  8. @JsonKey.new(name: 'inline_message_id') String? inlineMessageId,
  9. @JsonKey.new(name: 'chat_type') ChatType? chatType,
  10. @JsonKey.new(name: 'widget_id') String? widgetId,
})

Creates a WidgetQuery.

Implementation

const factory WidgetQuery({
  /// Unique identifier of the query.
  @JsonKey(name: 'id') required String id,

  /// User who sent the query.
  @JsonKey(name: 'from') required User from,

  /// Global identifier for the chat where the message was sent.
  @JsonKey(name: 'chat_instance') required String chatInstance,

  /// Type of the query and its associated wallet data, if any.
  @JsonKey(name: 'type') required WidgetQueryType type,

  /// Data sent by the widget, 1-64 bytes.
  @JsonKey(name: 'data') required String data,

  /// Chat containing the widget message, if the message is not inline.
  @JsonKey(name: 'chat') Chat? chat,

  /// Identifier of the widget message, if the message is not inline.
  @JsonKey(name: 'message_id') int? messageId,

  /// Identifier of the inline message containing the widget.
  @JsonKey(name: 'inline_message_id') String? inlineMessageId,

  /// Type of the chat, for widgets in inline messages.
  @JsonKey(name: 'chat_type') ChatType? chatType,

  /// Identifier of the widget, if it is shared.
  @JsonKey(name: 'widget_id') String? widgetId,
}) = _WidgetQuery;