(
results: list[dict[str, Any]],
response: requests.Response,
total_count: int | None = None,
incomplete_results: bool | None = None,
)
| 72 | |
| 73 | |
| 74 | def build_paginated_response( |
| 75 | results: list[dict[str, Any]], |
| 76 | response: requests.Response, |
| 77 | total_count: int | None = None, |
| 78 | incomplete_results: bool | None = None, |
| 79 | ) -> dict[str, Any]: |
| 80 | data: dict[str, Any] = { |
| 81 | "results": results, |
| 82 | } |
| 83 | |
| 84 | if response.links.get("prev"): |
| 85 | data["previous"] = response.links.get("prev") |
| 86 | |
| 87 | if response.links.get("next"): |
| 88 | data["next"] = response.links.get("next") |
| 89 | |
| 90 | if total_count: |
| 91 | data["total_count"] = total_count |
| 92 | |
| 93 | if incomplete_results: |
| 94 | data["incomplete_results"] = incomplete_results |
| 95 | |
| 96 | return data |
| 97 | |
| 98 | |
| 99 | def create_github_issue( |
no test coverage detected
searching dependent graphs…