TransactionPartner class sealed
This object describes the source of a transaction, or its recipient for outgoing transactions. It can be one of:
TransactionPartnerFragment
TransactionPartnerUser
TransactionPartnerOther
TransactionPartnerTelegramAds
TransactionPartnerAffiliateProgram
TransactionPartnerTelegramApi
TransactionPartnerChat
- Annotations
-
- @Freezed(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)
Constructors
- TransactionPartner.affiliateProgram({@JsonKey(name: 'type') @Default(TransactionPartnerType.affiliateProgram) TransactionPartnerType type, @JsonKey(name: 'sponsor_user') User? sponsorUser, @JsonKey(name: 'commission_per_mille') required int commissionPerMille})
-
Describes the affiliate program that issued the affiliate commission
received via this transaction
constfactory
- TransactionPartner.chat({@JsonKey(name: 'type') @Default(TransactionPartnerType.chat) TransactionPartnerType type, @JsonKey(name: 'chat') required Chat chat, @JsonKey(name: 'gift') Gift? gift})
-
Describes a transaction with a chat
constfactory
- TransactionPartner.fragment({@JsonKey(name: 'type') @Default(TransactionPartnerType.fragment) TransactionPartnerType type, @JsonKey(name: 'withdrawal_state') RevenueWithdrawalState? withdrawalState})
-
Represents a withdrawal transaction with Fragment
constfactory
-
TransactionPartner.fromJson(Map<
String, Object?> json) -
Creates the TransactionPartner instance from JSON
factory
- TransactionPartner.other({@JsonKey(name: 'type') @Default(TransactionPartnerType.other) TransactionPartnerType type})
-
Represents a transaction with an unknown source or recipient
constfactory
- TransactionPartner.telegramAds({@JsonKey(name: 'type') @Default(TransactionPartnerType.telegramAds) TransactionPartnerType type})
-
Represents a withdrawal transaction to the Telegram Ads platform
constfactory
- TransactionPartner.telegramApi({@JsonKey(name: 'type') @Default(TransactionPartnerType.telegramApi) TransactionPartnerType type, @JsonKey(name: 'request_count') int? requestCount})
-
Represents transaction with payment for paid broadcasting
constfactory
-
TransactionPartner.user({@JsonKey(name: 'type') @Default(TransactionPartnerType.user) TransactionPartnerType type, @JsonKey(name: 'transaction_type') required TransactionType transactionType, @JsonKey(name: 'user') required User user, @JsonKey(name: 'affiliate') AffiliateInfo? affiliate, @JsonKey(name: 'invoice_payload') String? invoicePayload, @JsonKey(name: 'subscription_period') int? subscriptionPeriod, @JsonKey(name: 'paid_media') List<
PaidMedia> ? paidMedia, @JsonKey(name: 'paid_media_payload') String? paidMediaPayload, @JsonKey(name: 'gift') Gift? gift, }) -
Represents a transaction with a user
constfactory
Properties
-
copyWith
→ $TransactionPartnerCopyWith<
TransactionPartner> -
Create a copy of TransactionPartner
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → TransactionPartnerType
-
Type of the transaction partner, must be "fragment"
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this TransactionPartner to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited