def METHOD_NAME(self, pb_type, filter='', odt_level=type_pb2.OdtLevel.all):
    """
    iterator on all navitia objects that match a filter
    """
    req = request_pb2.Request()
    req.requested_api = type_pb2.PTREFERENTIAL
    req.ptref.requested_type = pb_type
    req.ptref.count = 20
    req.ptref.start_page = 0
    req.ptref.depth = 1
    req.ptref.filter = filter
    if pb_type == type_pb2.LINE:
        req.ptref.odt_level = odt_level
    while True:
        result = self.instance.send_and_receive(req)
        objects = getattr(result, PT_TYPE_RESPONSE_MAPPING[pb_type])
        if not objects:
            # when no more objects are yielded we stop
            return
        for o in objects:
            yield o
        req.ptref.start_page += 1
        if req.ptref.count > result.pagination.itemsOnPage:
            # we did not get as much results as planned, we can stop
            return