Builds a list of CommandId.

def _build_command_ids(issued_commands):
    """Builds a list of CommandId."""
    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]