TransactionPartner.user constructor
- @Assert('type == TransactionPartnerType.user', 'type must be TransactionPartnerType.user')
- @JsonKey(name: 'type') @Default(TransactionPartnerType.user) TransactionPartnerType type,
- @JsonKey(name: 'user') required User user,
- @JsonKey(name: 'invoice_payload') String? invoicePayload,
- @JsonKey(name: 'paid_media') List<
PaidMedia> ? paidMedia, - @JsonKey(name: 'paid_media_payload') String? paidMediaPayload,
- @JsonKey(name: 'subscription_period') int? subscriptionPeriod,
- @JsonKey(name: 'gift') Gift? gift,
- @JsonKey(name: 'affiliate') AffiliateInfo? affiliate,
Represents a transaction with a user
Implementation
@Assert(
'type == TransactionPartnerType.user',
'type must be TransactionPartnerType.user',
)
const factory TransactionPartner.user({
/// Type of the transaction partner, must be "user"
@JsonKey(name: 'type')
@Default(TransactionPartnerType.user)
TransactionPartnerType type,
/// Information about the user.
@JsonKey(name: 'user') required final User user,
/// Bot-specified invoice payload.
@JsonKey(name: 'invoice_payload') final String? invoicePayload,
/// Optional. Information about the paid media bought by the user
@JsonKey(name: 'paid_media') final List<PaidMedia>? paidMedia,
/// Optional. Bot-specified paid media payload
@JsonKey(name: 'paid_media_payload') final String? paidMediaPayload,
/// Optional. The duration of the paid subscription.
@JsonKey(name: 'subscription_period') final int? subscriptionPeriod,
/// Optional. The gift sent to the user by the bot.
@JsonKey(name: 'gift') final Gift? gift,
/// Optional. Information about the affiliate that received a commission via
/// this transaction
@JsonKey(name: 'affiliate') final AffiliateInfo? affiliate,
}) = TransactionPartnerUser;