OwnedGift.unique constructor

const OwnedGift.unique({
  1. @JsonKey(name: 'type') @Default(OwnedGiftType.unique) OwnedGiftType type,
  2. @JsonKey(name: 'gift') required UniqueGift gift,
  3. @JsonKey(name: 'owned_gift_id') String? ownedGiftId,
  4. @JsonKey(name: 'sender_user') User? senderUser,
  5. @JsonKey(name: 'send_date') required int sendDate,
  6. @JsonKey(name: 'is_saved') bool? isSaved,
  7. @JsonKey(name: 'can_be_transferred') bool? canBeTransferred,
  8. @JsonKey(name: 'transfer_star_count') int? transferStarCount,
})

Describes a unique gift received and owned by a user or a chat.

Implementation

const factory OwnedGift.unique({
  /// Type of the gift, always "unique"
  @JsonKey(name: 'type')
  @Default(OwnedGiftType.unique)
  final OwnedGiftType type,

  /// Information about the unique gift
  @JsonKey(name: 'gift') required UniqueGift gift,

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

  /// Optional. Sender of the gift if it is a known user
  @JsonKey(name: 'sender_user') User? senderUser,

  /// Date the gift was sent in Unix time
  @JsonKey(name: 'send_date') required int sendDate,

  /// Optional. True, if the gift is displayed on the account's profile page;
  /// for gifts received on behalf of business accounts only
  @JsonKey(name: 'is_saved') bool? isSaved,

  /// Optional. True, if the gift can be transferred to another owner;
  /// for gifts received on behalf of business accounts only
  @JsonKey(name: 'can_be_transferred') bool? canBeTransferred,

  /// 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,
}) = OwnedGiftUnique;