UniqueGift constructor

const UniqueGift({
  1. @JsonKey.new(name: 'gift_id') required String giftId,
  2. @JsonKey.new(name: 'base_name') required String baseName,
  3. @JsonKey.new(name: 'name') required String name,
  4. @JsonKey.new(name: 'number') required int number,
  5. @JsonKey.new(name: 'model') required UniqueGiftModel model,
  6. @JsonKey.new(name: 'symbol') required UniqueGiftSymbol symbol,
  7. @JsonKey.new(name: 'backdrop') required UniqueGiftBackdrop backdrop,
  8. @JsonKey.new(name: 'publisher_chat') Chat? publisherChat,
  9. @JsonKey.new(name: 'is_from_blockchain') bool? isFromBlockchain,
  10. @JsonKey.new(name: 'is_premium') bool? isPremium,
  11. @JsonKey.new(name: 'colors') UniqueGiftColors? colors,
})

Creates a new UniqueGift object.

Implementation

const factory UniqueGift({
  ///  Identifier of the regular gift from which the gift was upgraded
  @JsonKey(name: 'gift_id') required String giftId,

  /// Human-readable name of the regular gift from which this unique gift was upgraded
  @JsonKey(name: 'base_name') required String baseName,

  /// Unique name of the gift. This name can be used in `https://t.me/nft/...` links and story areas
  @JsonKey(name: 'name') required String name,

  /// Unique number of the upgraded gift among gifts upgraded from the same regular gift
  @JsonKey(name: 'number') required int number,

  /// Model of the gift
  @JsonKey(name: 'model') required UniqueGiftModel model,

  /// Symbol of the gift
  @JsonKey(name: 'symbol') required UniqueGiftSymbol symbol,

  /// Backdrop of the gift
  @JsonKey(name: 'backdrop') required UniqueGiftBackdrop backdrop,

  /// Optional. Information about the chat that published the gift
  @JsonKey(name: 'publisher_chat') Chat? publisherChat,

  /// Optional. True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram
  @JsonKey(name: 'is_from_blockchain') bool? isFromBlockchain,

  /// Optional. True, if the gift can only be purchased by Telegram Premium subscribers
  @JsonKey(name: 'is_premium') bool? isPremium,

  /// Optional. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only
  @JsonKey(name: 'colors') UniqueGiftColors? colors,
}) = _UniqueGift;