AffiliateInfo class abstract

Contains information about the affiliate that received a commission via this transaction.

Available extensions
Annotations
  • @freezed

Constructors

AffiliateInfo({@JsonKey.new(name: 'affiliate_user') User? affiliateUser, @JsonKey.new(name: 'affiliate_chat') Chat? affiliateChat, @JsonKey.new(name: 'commission_per_mille') required int commissionPerMille, @JsonKey.new(name: 'amount') required int amount, @JsonKey.new(name: 'nanostar_amount') int? nanostarAmount})
Constructs an AffiliateInfo object.
const
factory
AffiliateInfo.fromJson(Map<String, dynamic> json)
Creates an AffiliateInfo object from JSON.
factory

Properties

affiliateChat → Chat?
The chat that received an affiliate commission if it was received by a chat.
no setterinherited
affiliateUser → User?
The bot or the user that received an affiliate commission if it was received by a bot or a user.
no setterinherited
amount → int
Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds.
no setterinherited
commissionPerMille → int
The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users.
no setterinherited
copyWith → $AffiliateInfoCopyWith<AffiliateInfo>
Create a copy of AffiliateInfo with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
nanostarAmount → int?
The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Available on AffiliateInfo, provided by the AffiliateInfoPatterns extension

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

Available on AffiliateInfo, provided by the AffiliateInfoPatterns extension

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

Available on AffiliateInfo, provided by the AffiliateInfoPatterns 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 AffiliateInfo to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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