Skip to content

Commit 2847a10

Browse files
feat(api): improve SearchRepositories pagination with next_page and total_count
1 parent 03bd185 commit 2847a10

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 160
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f35d75f04023f8de20cc787ab5202c4853a79ea14fa8e639f598e034b312207f.yml
3-
openapi_spec_hash: 0b2bf8b46a5bb29402fb9ae08ce6314f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b40906da1a429be933f59cd9c3b2f7197aef9b302033558e7cbb65579357240a.yml
3+
openapi_spec_hash: bc0aec8cac7bfb2a69792bb43cfe50d2
44
config_hash: d3267594264bfb76d2ee7e881d5f8a5a

src/gitpod/types/runner_search_repositories_response.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010

1111

1212
class Pagination(BaseModel):
13-
"""Pagination information for the response"""
13+
"""
14+
Pagination information for the response.
15+
Token format: "NEXT_PAGE/TOTAL_PAGES/TOTAL_COUNT" (e.g., "2/40/1000").
16+
Use -1 for unknown values (e.g., "2/-1/-1" when totals unavailable).
17+
Empty token means no more pages.
18+
"""
1419

1520
next_token: Optional[str] = FieldInfo(alias="nextToken", default=None)
1621
"""Token passed for retrieving the next set of results.
@@ -29,10 +34,18 @@ class Repository(BaseModel):
2934

3035
class RunnerSearchRepositoriesResponse(BaseModel):
3136
last_page: Optional[int] = FieldInfo(alias="lastPage", default=None)
32-
"""Last page in the responses"""
37+
"""Deprecated: Use pagination token instead.
38+
39+
Total pages can be extracted from token.
40+
"""
3341

3442
pagination: Optional[Pagination] = None
35-
"""Pagination information for the response"""
43+
"""
44+
Pagination information for the response. Token format:
45+
"NEXT_PAGE/TOTAL_PAGES/TOTAL_COUNT" (e.g., "2/40/1000"). Use -1 for unknown
46+
values (e.g., "2/-1/-1" when totals unavailable). Empty token means no more
47+
pages.
48+
"""
3649

3750
repositories: Optional[List[Repository]] = None
3851
"""List of repositories matching the search criteria"""

0 commit comments

Comments
 (0)