TransactionPartner.chat constructor

  1. @Assert('type == TransactionPartnerType.chat', 'type must be TransactionPartnerType.chat')
const TransactionPartner.chat({
  1. @JsonKey(name: 'type') @Default(TransactionPartnerType.chat) TransactionPartnerType type,
  2. @JsonKey(name: 'chat') required Chat chat,
  3. @JsonKey(name: 'gift') Gift? gift,
})

Describes a transaction with a chat

Implementation

@Assert(
  'type == TransactionPartnerType.chat',
  'type must be TransactionPartnerType.chat',
)
const factory TransactionPartner.chat({
  /// Type of the transaction partner, must be "chat"
  @JsonKey(name: 'type')
  @Default(TransactionPartnerType.chat)
  TransactionPartnerType type,

  /// Information about the chat.
  @JsonKey(name: 'chat') required final Chat chat,

  /// The gift sent to the chat by the bot.
  @JsonKey(name: 'gift') final Gift? gift,
}) = TransactionPartnerChat;