def METHOD_NAME(self):
    page = self
    while True:
        if (
            "ending_before" in self._retrieve_params
            and "starting_after" not in self._retrieve_params
        ):
            for item in reversed(page):  # type: ignore
                yield item
            page = page.previous_page()
        else:
            for item in page:  # type: ignore
                yield item
            page = page.next_page()
        if page.is_empty:
            break