OwnedGift.regular constructor

const OwnedGift.regular({
  1. @JsonKey(name: 'type') @Default(OwnedGiftType.regular) OwnedGiftType type,
  2. @JsonKey(name: 'gift') required Gift 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: 'text') String? text,
  7. @JsonKey(name: 'entities') List<MessageEntity>? entities,
  8. @JsonKey(name: 'is_private') bool? isPrivate,
  9. @JsonKey(name: 'is_saved') bool? isSaved,
  10. @JsonKey(name: 'can_be_upgraded') bool? canBeUpgraded,
  11. @JsonKey(name: 'was_refunded') bool? wasRefunded,
  12. @JsonKey(name: 'convert_star_count') int? convertStarCount,
  13. @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;