GiftInfo class abstract

Describes a service message about a regular gift that was sent or received.

Available extensions
Annotations
  • @freezed

Constructors

GiftInfo({@JsonKey.new(name: 'gift') required Gift gift, @JsonKey.new(name: 'owned_gift_id') String? ownedGiftId, @JsonKey.new(name: 'convert_star_count') int? convertStarCount, @JsonKey.new(name: 'prepaid_upgrade_star_count') int? prepaidUpgradeStarCount, @JsonKey.new(name: 'can_be_upgraded') bool? canBeUpgraded, @JsonKey.new(name: 'text') String? text, @JsonKey.new(name: 'entities') List<MessageEntity>? entities, @JsonKey.new(name: 'is_private') bool? isPrivate, @JsonKey.new(name: 'is_upgrade_separate') bool? isUpgradeSeparate, @JsonKey.new(name: 'unique_gift_number') int? uniqueGiftNumber})
Creates a new GiftInfo object.
const
factory
GiftInfo.fromJson(Map<String, dynamic> json)
Creates a new GiftInfo object from a JSON Map.
factory

Properties

canBeUpgraded bool?
Optional. True, if the gift can be upgraded to a unique gift
no setterinherited
convertStarCount int?
Optional. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible
no setterinherited
copyWith → $GiftInfoCopyWith<GiftInfo>
Create a copy of GiftInfo with the given fields replaced by the non-null parameter values.
no setterinherited
entities List<MessageEntity>?
Optional. Special entities that appear in the text
no setterinherited
gift Gift
Information about the gift
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isPrivate bool?
Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
no setterinherited
isUpgradeSeparate bool?
Optional. True, if the gift's upgrade was purchased after the gift was sent
no setterinherited
ownedGiftId String?
Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts
no setterinherited
prepaidUpgradeStarCount int?
Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String?
Optional. Text of the message that was added to the gift
no setterinherited
uniqueGiftNumber int?
Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_GiftInfo value)) → TResult

Available on GiftInfo, provided by the GiftInfoPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_GiftInfo value)?) → TResult?

Available on GiftInfo, provided by the GiftInfoPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_GiftInfo value)?, {required TResult orElse()}) → TResult

Available on GiftInfo, provided by the GiftInfoPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this GiftInfo to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited