UniqueGiftInfo constructor

const UniqueGiftInfo({
  1. @JsonKey.new(name: 'gift') required UniqueGift gift,
  2. @JsonKey.new(name: 'origin') required UniqueGiftOriginType origin,
  3. @JsonKey.new(name: 'text') String? text,
  4. @JsonKey.new(name: 'entities') List<MessageEntity>? entities,
  5. @JsonKey.new(name: 'is_private') bool? isPrivate,
  6. @JsonKey.new(name: 'last_resale_currency') String? lastResaleCurrency,
  7. @JsonKey.new(name: 'last_resale_amount') int? lastResaleAmount,
  8. @JsonKey.new(name: 'owned_gift_id') String? ownedGiftId,
  9. @JsonKey.new(name: 'transfer_star_count') int? transferStarCount,
  10. @JsonKey.new(name: 'next_transfer_date') int? nextTransferDate,
})

Creates a new UniqueGiftInfo object.

Implementation

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

  /// Origin of the gift. Currently, either "upgrade" for gifts upgraded
  /// from regular gifts, "transfer" for gifts transferred from other users
  /// or channels, "resale" for gifts bought from other users,
  /// "gifted_upgrade" for upgrades purchased after the gift was sent, or
  /// "offer" for gifts bought or sold through gift purchase offers
  @JsonKey(name: 'origin') required UniqueGiftOriginType origin,

  /// 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,

  /// Optional. For gifts bought from other users, the currency in which the payment for the gift was done.
  /// Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
  @JsonKey(name: 'last_resale_currency') String? lastResaleCurrency,

  /// Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins
  @JsonKey(name: 'last_resale_amount') int? lastResaleAmount,

  /// 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 must be paid to transfer the gift;
  /// omitted if the bot cannot transfer the gift
  @JsonKey(name: 'transfer_star_count') int? transferStarCount,

  /// Optional. Point in time (Unix timestamp) when the gift can be transferred.
  /// If it is in the past, then the gift can be transferred now
  @JsonKey(name: 'next_transfer_date') int? nextTransferDate,
}) = _UniqueGiftInfo;