OwnedGift.unique constructor
const
OwnedGift.unique({
- @JsonKey(name: 'type') @Default(OwnedGiftType.unique) OwnedGiftType type,
- @JsonKey(name: 'gift') required UniqueGift gift,
- @JsonKey(name: 'owned_gift_id') String? ownedGiftId,
- @JsonKey(name: 'sender_user') User? senderUser,
- @JsonKey(name: 'send_date') required int sendDate,
- @JsonKey(name: 'is_saved') bool? isSaved,
- @JsonKey(name: 'can_be_transferred') bool? canBeTransferred,
- @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;