OwnedGift.regular constructor
const
OwnedGift.regular({
- @JsonKey(name: 'type') @Default(OwnedGiftType.regular) OwnedGiftType type,
- @JsonKey(name: 'gift') required Gift gift,
- @JsonKey(name: 'owned_gift_id') String? ownedGiftId,
- @JsonKey(name: 'sender_user') User? senderUser,
- @JsonKey(name: 'send_date') required int sendDate,
- @JsonKey(name: 'text') String? text,
- @JsonKey(name: 'entities') List<
MessageEntity> ? entities, - @JsonKey(name: 'is_private') bool? isPrivate,
- @JsonKey(name: 'is_saved') bool? isSaved,
- @JsonKey(name: 'can_be_upgraded') bool? canBeUpgraded,
- @JsonKey(name: 'was_refunded') bool? wasRefunded,
- @JsonKey(name: 'convert_star_count') int? convertStarCount,
- @JsonKey(name: 'prepaid_upgrade_star_count') int? prepaidUpgradeStarCount,
Describes a regular gift owned by a user or a chat.
Implementation
const factory OwnedGift.regular({
/// Type of the gift, always "regular"
@JsonKey(name: 'type')
@Default(OwnedGiftType.regular)
final OwnedGiftType type,
/// Information about the regular gift
@JsonKey(name: 'gift') required Gift gift,
/// Optional. Unique identifier of the 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. 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. 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 upgraded to a unique gift;
/// for gifts received on behalf of business accounts only
@JsonKey(name: 'can_be_upgraded') bool? canBeUpgraded,
/// Optional. True, if the gift was refunded and isn't available anymore
@JsonKey(name: 'was_refunded') bool? wasRefunded,
/// Optional. Number of Telegram Stars that can be claimed by the receiver
/// instead of the gift; omitted if the gift cannot be converted to Telegram Stars
@JsonKey(name: 'convert_star_count') int? convertStarCount,
/// Optional. Number of Telegram Stars that were paid by the sender for
/// the ability to upgrade the gift
@JsonKey(name: 'prepaid_upgrade_star_count') int? prepaidUpgradeStarCount,
}) = OwnedGiftRegular;