code: def _build_command_ids(issued_commands):
      
      if isinstance(issued_commands, IssuedCommand):
          entry = issued_commands._proto.commandQueueEntry
          return [entry.cmdId]
      else:
          return [issued_command._proto.commandQueueEntry.cmdId
                  for issued_command in issued_commands]
docs: Builds a list of CommandId.