InputBusinessBotRecipients.deserialize constructor

InputBusinessBotRecipients.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory InputBusinessBotRecipients.deserialize(BinaryReader reader) {
  // Read [InputBusinessBotRecipients] fields.
  final flags = reader.readInt32();
  final existingChats = (flags & 1) != 0;
  final newChats = (flags & 2) != 0;
  final contacts = (flags & 4) != 0;
  final nonContacts = (flags & 8) != 0;
  final excludeSelected = (flags & 32) != 0;
  final hasUsersField = (flags & 16) != 0;
  final users =
      hasUsersField ? reader.readVectorObject<InputUserBase>() : null;
  final hasExcludeUsersField = (flags & 64) != 0;
  final excludeUsers =
      hasExcludeUsersField ? reader.readVectorObject<InputUserBase>() : null;

  // Construct [InputBusinessBotRecipients] object.
  final returnValue = InputBusinessBotRecipients(
    existingChats: existingChats,
    newChats: newChats,
    contacts: contacts,
    nonContacts: nonContacts,
    excludeSelected: excludeSelected,
    users: users?.items,
    excludeUsers: excludeUsers?.items,
  );

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