UniqueGiftInfo class abstract
Describes a service message about a unique gift that was sent or received.
- Available extensions
- Annotations
-
- @freezed
Constructors
-
UniqueGiftInfo({@JsonKey.new(name: 'gift') required UniqueGift gift, @JsonKey.new(name: 'origin') required UniqueGiftOriginType origin, @JsonKey.new(name: 'text') String? text, @JsonKey.new(name: 'entities') List<
MessageEntity> ? entities, @JsonKey.new(name: 'is_private') bool? isPrivate, @JsonKey.new(name: 'last_resale_currency') String? lastResaleCurrency, @JsonKey.new(name: 'last_resale_amount') int? lastResaleAmount, @JsonKey.new(name: 'owned_gift_id') String? ownedGiftId, @JsonKey.new(name: 'transfer_star_count') int? transferStarCount, @JsonKey.new(name: 'next_transfer_date') int? nextTransferDate}) -
Creates a new UniqueGiftInfo object.
constfactory
-
UniqueGiftInfo.fromJson(Map<
String, dynamic> json) -
Creates a new UniqueGiftInfo object from a JSON Map.
factory
Properties
-
copyWith
→ $UniqueGiftInfoCopyWith<
UniqueGiftInfo> -
Create a copy of UniqueGiftInfo
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 → UniqueGift
-
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
- lastResaleAmount → int?
-
Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins
no setterinherited
- lastResaleCurrency → String?
-
Optional. For gifts bought from other users, the currency in which the payment for the gift was done.
Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
no setterinherited
- nextTransferDate → int?
-
Optional. Point in time (Unix timestamp) when the gift can be transferred.
If it is in the past, then the gift can be transferred now
no setterinherited
- origin → UniqueGiftOriginType
-
Origin of the gift. Currently, either "upgrade" for gifts upgraded
from regular gifts, "transfer" for gifts transferred from other users
or channels, "resale" for gifts bought from other users,
"gifted_upgrade" for upgrades purchased after the gift was sent, or
"offer" for gifts bought or sold through gift purchase offers
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
- 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
- transferStarCount → int?
-
Optional. Number of Telegram Stars that must be paid to transfer the gift;
omitted if the bot cannot transfer the gift
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_UniqueGiftInfo value)) → TResult -
Available on UniqueGiftInfo, provided by the UniqueGiftInfoPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_UniqueGiftInfo value)?) → TResult? -
Available on UniqueGiftInfo, provided by the UniqueGiftInfoPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_UniqueGiftInfo value)?, {required TResult orElse()}) → TResult -
Available on UniqueGiftInfo, provided by the UniqueGiftInfoPatterns extension
A variant ofmapthat fallback to returningorElse. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this UniqueGiftInfo to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited