GiftInfo constructor

const GiftInfo({
  1. @JsonKey(name: 'gift') required Gift gift,
  2. @JsonKey(name: 'owned_gift_id') String? ownedGiftId,
  3. @JsonKey(name: 'convert_star_count') int? convertStarCount,
  4. @JsonKey(name: 'prepaid_upgrade_star_count') int? prepaidUpgradeStarCount,
  5. @JsonKey(name: 'can_be_upgraded') bool? canBeUpgraded,
  6. @JsonKey(name: 'text') String? text,
  7. @JsonKey(name: 'entities') List<MessageEntity>? entities,
  8. @JsonKey(name: 'is_private') bool? isPrivate,
})

Creates a new GiftInfo object.

Implementation

const factory GiftInfo({
  /// Information about the gift
  @JsonKey(name: 'gift') required Gift gift,

  /// Optional. Unique identifier of the received gift for the bot; only present
  /// for gifts received on behalf of business accounts
  @JsonKey(name: 'owned_gift_id') String? ownedGiftId,

  /// Optional. Number of Telegram Stars that can be claimed by the receiver by
  /// converting the gift; omitted if conversion to Telegram Stars is impossible
  @JsonKey(name: 'convert_star_count') int? convertStarCount,

  /// Optional. Number of Telegram Stars that were prepaid by the sender for
  /// the ability to upgrade the gift
  @JsonKey(name: 'prepaid_upgrade_star_count') int? prepaidUpgradeStarCount,

  /// Optional. True, if the gift can be upgraded to a unique gift
  @JsonKey(name: 'can_be_upgraded') bool? canBeUpgraded,

  /// Optional. Text of the message that was added to the gift
  @JsonKey(name: 'text') String? text,

  /// Optional. Special entities that appear in the text
  @JsonKey(name: 'entities') List<MessageEntity>? entities,

  /// Optional. True, if the sender and gift text are shown only to the gift
  /// receiver; otherwise, everyone will be able to see them
  @JsonKey(name: 'is_private') bool? isPrivate,
}) = _GiftInfo;