UpdateBotNewBusinessMessage.deserialize constructor

UpdateBotNewBusinessMessage.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory UpdateBotNewBusinessMessage.deserialize(BinaryReader reader) {
  // Read [UpdateBotNewBusinessMessage] fields.
  final flags = reader.readInt32();
  final connectionId = reader.readString();
  final message = reader.readObject() as MessageBase;
  final hasReplyToMessageField = (flags & 1) != 0;
  final replyToMessage =
      hasReplyToMessageField ? reader.readObject() as MessageBase : null;
  final qts = reader.readInt32();

  // Construct [UpdateBotNewBusinessMessage] object.
  final returnValue = UpdateBotNewBusinessMessage(
    connectionId: connectionId,
    message: message,
    replyToMessage: replyToMessage,
    qts: qts,
  );

  // Now return the deserialized [UpdateBotNewBusinessMessage].
  return returnValue;
}