def _get_data(self, url: str, name_of_data_node: str) -> dict: """ Helper function to fetch data from admin and take care of pageing Parameters ---------- :param url: API endpoint address :param name_of_data_node: Name of the key where the requested data is stored Returns ------- :return A list of the data requested """ r = requests.get(url) if r.ok: r_json = r.json() data = r_json[name_of_data_node] if r_json["next"]: # The data is paged. Request next page return data + self._get_data(r_json["next"], name_of_data_node) else: return data else: logging.error("Lime GO answered with an error! %s", r.status_code) r.raise_for_status()