runloop_api_client 0.61.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. runloop_api_client/__init__.py +92 -0
  2. runloop_api_client/_base_client.py +1995 -0
  3. runloop_api_client/_client.py +668 -0
  4. runloop_api_client/_compat.py +219 -0
  5. runloop_api_client/_constants.py +14 -0
  6. runloop_api_client/_exceptions.py +108 -0
  7. runloop_api_client/_files.py +123 -0
  8. runloop_api_client/_models.py +835 -0
  9. runloop_api_client/_qs.py +150 -0
  10. runloop_api_client/_resource.py +43 -0
  11. runloop_api_client/_response.py +832 -0
  12. runloop_api_client/_streaming.py +520 -0
  13. runloop_api_client/_types.py +260 -0
  14. runloop_api_client/_utils/__init__.py +64 -0
  15. runloop_api_client/_utils/_compat.py +45 -0
  16. runloop_api_client/_utils/_datetime_parse.py +136 -0
  17. runloop_api_client/_utils/_logs.py +25 -0
  18. runloop_api_client/_utils/_proxy.py +65 -0
  19. runloop_api_client/_utils/_reflection.py +42 -0
  20. runloop_api_client/_utils/_resources_proxy.py +24 -0
  21. runloop_api_client/_utils/_streams.py +12 -0
  22. runloop_api_client/_utils/_sync.py +86 -0
  23. runloop_api_client/_utils/_transform.py +457 -0
  24. runloop_api_client/_utils/_typing.py +156 -0
  25. runloop_api_client/_utils/_utils.py +421 -0
  26. runloop_api_client/_version.py +4 -0
  27. runloop_api_client/lib/.keep +4 -0
  28. runloop_api_client/lib/polling.py +75 -0
  29. runloop_api_client/lib/polling_async.py +60 -0
  30. runloop_api_client/pagination.py +761 -0
  31. runloop_api_client/py.typed +0 -0
  32. runloop_api_client/resources/__init__.py +103 -0
  33. runloop_api_client/resources/benchmarks/__init__.py +33 -0
  34. runloop_api_client/resources/benchmarks/benchmarks.py +982 -0
  35. runloop_api_client/resources/benchmarks/runs.py +587 -0
  36. runloop_api_client/resources/blueprints.py +1206 -0
  37. runloop_api_client/resources/devboxes/__init__.py +89 -0
  38. runloop_api_client/resources/devboxes/browsers.py +267 -0
  39. runloop_api_client/resources/devboxes/computers.py +648 -0
  40. runloop_api_client/resources/devboxes/devboxes.py +3414 -0
  41. runloop_api_client/resources/devboxes/disk_snapshots.py +519 -0
  42. runloop_api_client/resources/devboxes/executions.py +1059 -0
  43. runloop_api_client/resources/devboxes/logs.py +197 -0
  44. runloop_api_client/resources/objects.py +860 -0
  45. runloop_api_client/resources/repositories.py +717 -0
  46. runloop_api_client/resources/scenarios/__init__.py +47 -0
  47. runloop_api_client/resources/scenarios/runs.py +949 -0
  48. runloop_api_client/resources/scenarios/scenarios.py +1079 -0
  49. runloop_api_client/resources/scenarios/scorers.py +629 -0
  50. runloop_api_client/resources/secrets.py +500 -0
  51. runloop_api_client/types/__init__.py +95 -0
  52. runloop_api_client/types/benchmark_create_params.py +40 -0
  53. runloop_api_client/types/benchmark_definitions_params.py +15 -0
  54. runloop_api_client/types/benchmark_list_params.py +15 -0
  55. runloop_api_client/types/benchmark_list_public_params.py +15 -0
  56. runloop_api_client/types/benchmark_run_list_view.py +19 -0
  57. runloop_api_client/types/benchmark_run_view.py +51 -0
  58. runloop_api_client/types/benchmark_start_run_params.py +25 -0
  59. runloop_api_client/types/benchmark_update_params.py +40 -0
  60. runloop_api_client/types/benchmark_view.py +45 -0
  61. runloop_api_client/types/benchmarks/__init__.py +6 -0
  62. runloop_api_client/types/benchmarks/run_list_params.py +18 -0
  63. runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py +18 -0
  64. runloop_api_client/types/blueprint_build_log.py +16 -0
  65. runloop_api_client/types/blueprint_build_logs_list_view.py +16 -0
  66. runloop_api_client/types/blueprint_build_parameters.py +87 -0
  67. runloop_api_client/types/blueprint_create_params.py +90 -0
  68. runloop_api_client/types/blueprint_list_params.py +18 -0
  69. runloop_api_client/types/blueprint_list_public_params.py +18 -0
  70. runloop_api_client/types/blueprint_list_view.py +19 -0
  71. runloop_api_client/types/blueprint_preview_params.py +90 -0
  72. runloop_api_client/types/blueprint_preview_view.py +10 -0
  73. runloop_api_client/types/blueprint_view.py +86 -0
  74. runloop_api_client/types/devbox_async_execution_detail_view.py +40 -0
  75. runloop_api_client/types/devbox_create_params.py +70 -0
  76. runloop_api_client/types/devbox_create_ssh_key_response.py +16 -0
  77. runloop_api_client/types/devbox_create_tunnel_params.py +12 -0
  78. runloop_api_client/types/devbox_download_file_params.py +15 -0
  79. runloop_api_client/types/devbox_execute_async_params.py +25 -0
  80. runloop_api_client/types/devbox_execute_params.py +34 -0
  81. runloop_api_client/types/devbox_execute_sync_params.py +25 -0
  82. runloop_api_client/types/devbox_execution_detail_view.py +24 -0
  83. runloop_api_client/types/devbox_list_disk_snapshots_params.py +29 -0
  84. runloop_api_client/types/devbox_list_params.py +20 -0
  85. runloop_api_client/types/devbox_list_view.py +19 -0
  86. runloop_api_client/types/devbox_read_file_contents_params.py +15 -0
  87. runloop_api_client/types/devbox_read_file_contents_response.py +7 -0
  88. runloop_api_client/types/devbox_remove_tunnel_params.py +12 -0
  89. runloop_api_client/types/devbox_snapshot_disk_async_params.py +16 -0
  90. runloop_api_client/types/devbox_snapshot_disk_params.py +16 -0
  91. runloop_api_client/types/devbox_snapshot_list_view.py +19 -0
  92. runloop_api_client/types/devbox_snapshot_view.py +24 -0
  93. runloop_api_client/types/devbox_tunnel_view.py +16 -0
  94. runloop_api_client/types/devbox_update_params.py +16 -0
  95. runloop_api_client/types/devbox_upload_file_params.py +19 -0
  96. runloop_api_client/types/devbox_view.py +94 -0
  97. runloop_api_client/types/devbox_wait_for_command_params.py +25 -0
  98. runloop_api_client/types/devbox_write_file_contents_params.py +18 -0
  99. runloop_api_client/types/devboxes/__init__.py +32 -0
  100. runloop_api_client/types/devboxes/browser_create_params.py +13 -0
  101. runloop_api_client/types/devboxes/browser_view.py +25 -0
  102. runloop_api_client/types/devboxes/computer_create_params.py +24 -0
  103. runloop_api_client/types/devboxes/computer_keyboard_interaction_params.py +16 -0
  104. runloop_api_client/types/devboxes/computer_keyboard_interaction_response.py +15 -0
  105. runloop_api_client/types/devboxes/computer_mouse_interaction_params.py +30 -0
  106. runloop_api_client/types/devboxes/computer_mouse_interaction_response.py +15 -0
  107. runloop_api_client/types/devboxes/computer_screen_interaction_params.py +12 -0
  108. runloop_api_client/types/devboxes/computer_screen_interaction_response.py +15 -0
  109. runloop_api_client/types/devboxes/computer_view.py +19 -0
  110. runloop_api_client/types/devboxes/devbox_logs_list_view.py +39 -0
  111. runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py +20 -0
  112. runloop_api_client/types/devboxes/disk_snapshot_list_params.py +29 -0
  113. runloop_api_client/types/devboxes/disk_snapshot_update_params.py +16 -0
  114. runloop_api_client/types/devboxes/execution_execute_async_params.py +25 -0
  115. runloop_api_client/types/devboxes/execution_execute_sync_params.py +25 -0
  116. runloop_api_client/types/devboxes/execution_kill_params.py +18 -0
  117. runloop_api_client/types/devboxes/execution_retrieve_params.py +14 -0
  118. runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py +14 -0
  119. runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py +14 -0
  120. runloop_api_client/types/devboxes/execution_update_chunk.py +15 -0
  121. runloop_api_client/types/devboxes/log_list_params.py +15 -0
  122. runloop_api_client/types/input_context.py +15 -0
  123. runloop_api_client/types/input_context_param.py +16 -0
  124. runloop_api_client/types/input_context_update_param.py +16 -0
  125. runloop_api_client/types/object_create_params.py +19 -0
  126. runloop_api_client/types/object_download_params.py +12 -0
  127. runloop_api_client/types/object_download_url_view.py +10 -0
  128. runloop_api_client/types/object_list_params.py +27 -0
  129. runloop_api_client/types/object_list_public_params.py +27 -0
  130. runloop_api_client/types/object_list_view.py +22 -0
  131. runloop_api_client/types/object_view.py +28 -0
  132. runloop_api_client/types/repository_connection_list_view.py +19 -0
  133. runloop_api_client/types/repository_connection_view.py +16 -0
  134. runloop_api_client/types/repository_create_params.py +22 -0
  135. runloop_api_client/types/repository_inspection_details.py +77 -0
  136. runloop_api_client/types/repository_inspection_list_view.py +13 -0
  137. runloop_api_client/types/repository_list_params.py +21 -0
  138. runloop_api_client/types/repository_manifest_view.py +158 -0
  139. runloop_api_client/types/repository_refresh_params.py +16 -0
  140. runloop_api_client/types/scenario_create_params.py +53 -0
  141. runloop_api_client/types/scenario_definition_list_view.py +19 -0
  142. runloop_api_client/types/scenario_environment.py +25 -0
  143. runloop_api_client/types/scenario_environment_param.py +27 -0
  144. runloop_api_client/types/scenario_list_params.py +21 -0
  145. runloop_api_client/types/scenario_list_public_params.py +18 -0
  146. runloop_api_client/types/scenario_run_list_view.py +19 -0
  147. runloop_api_client/types/scenario_run_view.py +50 -0
  148. runloop_api_client/types/scenario_start_run_params.py +28 -0
  149. runloop_api_client/types/scenario_update_params.py +46 -0
  150. runloop_api_client/types/scenario_view.py +57 -0
  151. runloop_api_client/types/scenarios/__init__.py +14 -0
  152. runloop_api_client/types/scenarios/run_list_params.py +18 -0
  153. runloop_api_client/types/scenarios/scorer_create_params.py +18 -0
  154. runloop_api_client/types/scenarios/scorer_create_response.py +16 -0
  155. runloop_api_client/types/scenarios/scorer_list_params.py +15 -0
  156. runloop_api_client/types/scenarios/scorer_list_response.py +16 -0
  157. runloop_api_client/types/scenarios/scorer_retrieve_response.py +16 -0
  158. runloop_api_client/types/scenarios/scorer_update_params.py +18 -0
  159. runloop_api_client/types/scenarios/scorer_update_response.py +16 -0
  160. runloop_api_client/types/scenarios/scorer_validate_params.py +17 -0
  161. runloop_api_client/types/scenarios/scorer_validate_response.py +23 -0
  162. runloop_api_client/types/scoring_contract.py +13 -0
  163. runloop_api_client/types/scoring_contract_param.py +15 -0
  164. runloop_api_client/types/scoring_contract_result_view.py +16 -0
  165. runloop_api_client/types/scoring_contract_update_param.py +15 -0
  166. runloop_api_client/types/scoring_function.py +135 -0
  167. runloop_api_client/types/scoring_function_param.py +131 -0
  168. runloop_api_client/types/scoring_function_result_view.py +21 -0
  169. runloop_api_client/types/secret_create_params.py +23 -0
  170. runloop_api_client/types/secret_list_params.py +12 -0
  171. runloop_api_client/types/secret_list_view.py +22 -0
  172. runloop_api_client/types/secret_update_params.py +16 -0
  173. runloop_api_client/types/secret_view.py +22 -0
  174. runloop_api_client/types/shared/__init__.py +6 -0
  175. runloop_api_client/types/shared/after_idle.py +15 -0
  176. runloop_api_client/types/shared/code_mount_parameters.py +24 -0
  177. runloop_api_client/types/shared/launch_parameters.py +79 -0
  178. runloop_api_client/types/shared/run_profile.py +33 -0
  179. runloop_api_client/types/shared_params/__init__.py +6 -0
  180. runloop_api_client/types/shared_params/after_idle.py +15 -0
  181. runloop_api_client/types/shared_params/code_mount_parameters.py +25 -0
  182. runloop_api_client/types/shared_params/launch_parameters.py +81 -0
  183. runloop_api_client/types/shared_params/run_profile.py +34 -0
  184. runloop_api_client-0.61.0.dist-info/METADATA +496 -0
  185. runloop_api_client-0.61.0.dist-info/RECORD +187 -0
  186. runloop_api_client-0.61.0.dist-info/WHEEL +4 -0
  187. runloop_api_client-0.61.0.dist-info/licenses/LICENSE +7 -0
@@ -0,0 +1,761 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Any, List, Generic, TypeVar, Optional, cast
4
+ from typing_extensions import Protocol, override, runtime_checkable
5
+
6
+ from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage
7
+
8
+ __all__ = [
9
+ "SyncBlueprintsCursorIDPage",
10
+ "AsyncBlueprintsCursorIDPage",
11
+ "SyncDevboxesCursorIDPage",
12
+ "AsyncDevboxesCursorIDPage",
13
+ "SyncRepositoriesCursorIDPage",
14
+ "AsyncRepositoriesCursorIDPage",
15
+ "SyncDiskSnapshotsCursorIDPage",
16
+ "AsyncDiskSnapshotsCursorIDPage",
17
+ "SyncBenchmarksCursorIDPage",
18
+ "AsyncBenchmarksCursorIDPage",
19
+ "SyncBenchmarkRunsCursorIDPage",
20
+ "AsyncBenchmarkRunsCursorIDPage",
21
+ "SyncScenariosCursorIDPage",
22
+ "AsyncScenariosCursorIDPage",
23
+ "SyncScenarioRunsCursorIDPage",
24
+ "AsyncScenarioRunsCursorIDPage",
25
+ "SyncScenarioScorersCursorIDPage",
26
+ "AsyncScenarioScorersCursorIDPage",
27
+ "SyncObjectsCursorIDPage",
28
+ "AsyncObjectsCursorIDPage",
29
+ ]
30
+
31
+ _T = TypeVar("_T")
32
+
33
+
34
+ @runtime_checkable
35
+ class BlueprintsCursorIDPageItem(Protocol):
36
+ id: str
37
+
38
+
39
+ @runtime_checkable
40
+ class DevboxesCursorIDPageItem(Protocol):
41
+ id: str
42
+
43
+
44
+ @runtime_checkable
45
+ class RepositoriesCursorIDPageItem(Protocol):
46
+ id: str
47
+
48
+
49
+ @runtime_checkable
50
+ class DiskSnapshotsCursorIDPageItem(Protocol):
51
+ id: str
52
+
53
+
54
+ @runtime_checkable
55
+ class BenchmarksCursorIDPageItem(Protocol):
56
+ id: str
57
+
58
+
59
+ @runtime_checkable
60
+ class BenchmarkRunsCursorIDPageItem(Protocol):
61
+ id: str
62
+
63
+
64
+ @runtime_checkable
65
+ class ScenariosCursorIDPageItem(Protocol):
66
+ id: str
67
+
68
+
69
+ @runtime_checkable
70
+ class ScenarioRunsCursorIDPageItem(Protocol):
71
+ id: str
72
+
73
+
74
+ @runtime_checkable
75
+ class ScenarioScorersCursorIDPageItem(Protocol):
76
+ id: str
77
+
78
+
79
+ @runtime_checkable
80
+ class ObjectsCursorIDPageItem(Protocol):
81
+ id: str
82
+
83
+
84
+ class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
85
+ blueprints: List[_T]
86
+ has_more: Optional[bool] = None
87
+ total_count: Optional[int] = None
88
+
89
+ @override
90
+ def _get_page_items(self) -> List[_T]:
91
+ blueprints = self.blueprints
92
+ if not blueprints:
93
+ return []
94
+ return blueprints
95
+
96
+ @override
97
+ def has_next_page(self) -> bool:
98
+ has_more = self.has_more
99
+ if has_more is not None and has_more is False:
100
+ return False
101
+
102
+ return super().has_next_page()
103
+
104
+ @override
105
+ def next_page_info(self) -> Optional[PageInfo]:
106
+ blueprints = self.blueprints
107
+ if not blueprints:
108
+ return None
109
+
110
+ item = cast(Any, blueprints[-1])
111
+ if not isinstance(item, BlueprintsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
112
+ # TODO emit warning log
113
+ return None
114
+
115
+ return PageInfo(params={"starting_after": item.id})
116
+
117
+
118
+ class AsyncBlueprintsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
119
+ blueprints: List[_T]
120
+ has_more: Optional[bool] = None
121
+ total_count: Optional[int] = None
122
+
123
+ @override
124
+ def _get_page_items(self) -> List[_T]:
125
+ blueprints = self.blueprints
126
+ if not blueprints:
127
+ return []
128
+ return blueprints
129
+
130
+ @override
131
+ def has_next_page(self) -> bool:
132
+ has_more = self.has_more
133
+ if has_more is not None and has_more is False:
134
+ return False
135
+
136
+ return super().has_next_page()
137
+
138
+ @override
139
+ def next_page_info(self) -> Optional[PageInfo]:
140
+ blueprints = self.blueprints
141
+ if not blueprints:
142
+ return None
143
+
144
+ item = cast(Any, blueprints[-1])
145
+ if not isinstance(item, BlueprintsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
146
+ # TODO emit warning log
147
+ return None
148
+
149
+ return PageInfo(params={"starting_after": item.id})
150
+
151
+
152
+ class SyncDevboxesCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
153
+ devboxes: List[_T]
154
+ has_more: Optional[bool] = None
155
+ total_count: Optional[int] = None
156
+
157
+ @override
158
+ def _get_page_items(self) -> List[_T]:
159
+ devboxes = self.devboxes
160
+ if not devboxes:
161
+ return []
162
+ return devboxes
163
+
164
+ @override
165
+ def has_next_page(self) -> bool:
166
+ has_more = self.has_more
167
+ if has_more is not None and has_more is False:
168
+ return False
169
+
170
+ return super().has_next_page()
171
+
172
+ @override
173
+ def next_page_info(self) -> Optional[PageInfo]:
174
+ devboxes = self.devboxes
175
+ if not devboxes:
176
+ return None
177
+
178
+ item = cast(Any, devboxes[-1])
179
+ if not isinstance(item, DevboxesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
180
+ # TODO emit warning log
181
+ return None
182
+
183
+ return PageInfo(params={"starting_after": item.id})
184
+
185
+
186
+ class AsyncDevboxesCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
187
+ devboxes: List[_T]
188
+ has_more: Optional[bool] = None
189
+ total_count: Optional[int] = None
190
+
191
+ @override
192
+ def _get_page_items(self) -> List[_T]:
193
+ devboxes = self.devboxes
194
+ if not devboxes:
195
+ return []
196
+ return devboxes
197
+
198
+ @override
199
+ def has_next_page(self) -> bool:
200
+ has_more = self.has_more
201
+ if has_more is not None and has_more is False:
202
+ return False
203
+
204
+ return super().has_next_page()
205
+
206
+ @override
207
+ def next_page_info(self) -> Optional[PageInfo]:
208
+ devboxes = self.devboxes
209
+ if not devboxes:
210
+ return None
211
+
212
+ item = cast(Any, devboxes[-1])
213
+ if not isinstance(item, DevboxesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
214
+ # TODO emit warning log
215
+ return None
216
+
217
+ return PageInfo(params={"starting_after": item.id})
218
+
219
+
220
+ class SyncRepositoriesCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
221
+ repositories: List[_T]
222
+ has_more: Optional[bool] = None
223
+ total_count: Optional[int] = None
224
+
225
+ @override
226
+ def _get_page_items(self) -> List[_T]:
227
+ repositories = self.repositories
228
+ if not repositories:
229
+ return []
230
+ return repositories
231
+
232
+ @override
233
+ def has_next_page(self) -> bool:
234
+ has_more = self.has_more
235
+ if has_more is not None and has_more is False:
236
+ return False
237
+
238
+ return super().has_next_page()
239
+
240
+ @override
241
+ def next_page_info(self) -> Optional[PageInfo]:
242
+ repositories = self.repositories
243
+ if not repositories:
244
+ return None
245
+
246
+ item = cast(Any, repositories[-1])
247
+ if not isinstance(item, RepositoriesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
248
+ # TODO emit warning log
249
+ return None
250
+
251
+ return PageInfo(params={"starting_after": item.id})
252
+
253
+
254
+ class AsyncRepositoriesCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
255
+ repositories: List[_T]
256
+ has_more: Optional[bool] = None
257
+ total_count: Optional[int] = None
258
+
259
+ @override
260
+ def _get_page_items(self) -> List[_T]:
261
+ repositories = self.repositories
262
+ if not repositories:
263
+ return []
264
+ return repositories
265
+
266
+ @override
267
+ def has_next_page(self) -> bool:
268
+ has_more = self.has_more
269
+ if has_more is not None and has_more is False:
270
+ return False
271
+
272
+ return super().has_next_page()
273
+
274
+ @override
275
+ def next_page_info(self) -> Optional[PageInfo]:
276
+ repositories = self.repositories
277
+ if not repositories:
278
+ return None
279
+
280
+ item = cast(Any, repositories[-1])
281
+ if not isinstance(item, RepositoriesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
282
+ # TODO emit warning log
283
+ return None
284
+
285
+ return PageInfo(params={"starting_after": item.id})
286
+
287
+
288
+ class SyncDiskSnapshotsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
289
+ snapshots: List[_T]
290
+ has_more: Optional[bool] = None
291
+ total_count: Optional[int] = None
292
+
293
+ @override
294
+ def _get_page_items(self) -> List[_T]:
295
+ snapshots = self.snapshots
296
+ if not snapshots:
297
+ return []
298
+ return snapshots
299
+
300
+ @override
301
+ def has_next_page(self) -> bool:
302
+ has_more = self.has_more
303
+ if has_more is not None and has_more is False:
304
+ return False
305
+
306
+ return super().has_next_page()
307
+
308
+ @override
309
+ def next_page_info(self) -> Optional[PageInfo]:
310
+ snapshots = self.snapshots
311
+ if not snapshots:
312
+ return None
313
+
314
+ item = cast(Any, snapshots[-1])
315
+ if not isinstance(item, DiskSnapshotsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
316
+ # TODO emit warning log
317
+ return None
318
+
319
+ return PageInfo(params={"starting_after": item.id})
320
+
321
+
322
+ class AsyncDiskSnapshotsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
323
+ snapshots: List[_T]
324
+ has_more: Optional[bool] = None
325
+ total_count: Optional[int] = None
326
+
327
+ @override
328
+ def _get_page_items(self) -> List[_T]:
329
+ snapshots = self.snapshots
330
+ if not snapshots:
331
+ return []
332
+ return snapshots
333
+
334
+ @override
335
+ def has_next_page(self) -> bool:
336
+ has_more = self.has_more
337
+ if has_more is not None and has_more is False:
338
+ return False
339
+
340
+ return super().has_next_page()
341
+
342
+ @override
343
+ def next_page_info(self) -> Optional[PageInfo]:
344
+ snapshots = self.snapshots
345
+ if not snapshots:
346
+ return None
347
+
348
+ item = cast(Any, snapshots[-1])
349
+ if not isinstance(item, DiskSnapshotsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
350
+ # TODO emit warning log
351
+ return None
352
+
353
+ return PageInfo(params={"starting_after": item.id})
354
+
355
+
356
+ class SyncBenchmarksCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
357
+ benchmarks: List[_T]
358
+ has_more: Optional[bool] = None
359
+ total_count: Optional[int] = None
360
+
361
+ @override
362
+ def _get_page_items(self) -> List[_T]:
363
+ benchmarks = self.benchmarks
364
+ if not benchmarks:
365
+ return []
366
+ return benchmarks
367
+
368
+ @override
369
+ def has_next_page(self) -> bool:
370
+ has_more = self.has_more
371
+ if has_more is not None and has_more is False:
372
+ return False
373
+
374
+ return super().has_next_page()
375
+
376
+ @override
377
+ def next_page_info(self) -> Optional[PageInfo]:
378
+ benchmarks = self.benchmarks
379
+ if not benchmarks:
380
+ return None
381
+
382
+ item = cast(Any, benchmarks[-1])
383
+ if not isinstance(item, BenchmarksCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
384
+ # TODO emit warning log
385
+ return None
386
+
387
+ return PageInfo(params={"starting_after": item.id})
388
+
389
+
390
+ class AsyncBenchmarksCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
391
+ benchmarks: List[_T]
392
+ has_more: Optional[bool] = None
393
+ total_count: Optional[int] = None
394
+
395
+ @override
396
+ def _get_page_items(self) -> List[_T]:
397
+ benchmarks = self.benchmarks
398
+ if not benchmarks:
399
+ return []
400
+ return benchmarks
401
+
402
+ @override
403
+ def has_next_page(self) -> bool:
404
+ has_more = self.has_more
405
+ if has_more is not None and has_more is False:
406
+ return False
407
+
408
+ return super().has_next_page()
409
+
410
+ @override
411
+ def next_page_info(self) -> Optional[PageInfo]:
412
+ benchmarks = self.benchmarks
413
+ if not benchmarks:
414
+ return None
415
+
416
+ item = cast(Any, benchmarks[-1])
417
+ if not isinstance(item, BenchmarksCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
418
+ # TODO emit warning log
419
+ return None
420
+
421
+ return PageInfo(params={"starting_after": item.id})
422
+
423
+
424
+ class SyncBenchmarkRunsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
425
+ runs: List[_T]
426
+ has_more: Optional[bool] = None
427
+ total_count: Optional[int] = None
428
+
429
+ @override
430
+ def _get_page_items(self) -> List[_T]:
431
+ runs = self.runs
432
+ if not runs:
433
+ return []
434
+ return runs
435
+
436
+ @override
437
+ def has_next_page(self) -> bool:
438
+ has_more = self.has_more
439
+ if has_more is not None and has_more is False:
440
+ return False
441
+
442
+ return super().has_next_page()
443
+
444
+ @override
445
+ def next_page_info(self) -> Optional[PageInfo]:
446
+ runs = self.runs
447
+ if not runs:
448
+ return None
449
+
450
+ item = cast(Any, runs[-1])
451
+ if not isinstance(item, BenchmarkRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
452
+ # TODO emit warning log
453
+ return None
454
+
455
+ return PageInfo(params={"starting_after": item.id})
456
+
457
+
458
+ class AsyncBenchmarkRunsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
459
+ runs: List[_T]
460
+ has_more: Optional[bool] = None
461
+ total_count: Optional[int] = None
462
+
463
+ @override
464
+ def _get_page_items(self) -> List[_T]:
465
+ runs = self.runs
466
+ if not runs:
467
+ return []
468
+ return runs
469
+
470
+ @override
471
+ def has_next_page(self) -> bool:
472
+ has_more = self.has_more
473
+ if has_more is not None and has_more is False:
474
+ return False
475
+
476
+ return super().has_next_page()
477
+
478
+ @override
479
+ def next_page_info(self) -> Optional[PageInfo]:
480
+ runs = self.runs
481
+ if not runs:
482
+ return None
483
+
484
+ item = cast(Any, runs[-1])
485
+ if not isinstance(item, BenchmarkRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
486
+ # TODO emit warning log
487
+ return None
488
+
489
+ return PageInfo(params={"starting_after": item.id})
490
+
491
+
492
+ class SyncScenariosCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
493
+ scenarios: List[_T]
494
+ has_more: Optional[bool] = None
495
+ total_count: Optional[int] = None
496
+
497
+ @override
498
+ def _get_page_items(self) -> List[_T]:
499
+ scenarios = self.scenarios
500
+ if not scenarios:
501
+ return []
502
+ return scenarios
503
+
504
+ @override
505
+ def has_next_page(self) -> bool:
506
+ has_more = self.has_more
507
+ if has_more is not None and has_more is False:
508
+ return False
509
+
510
+ return super().has_next_page()
511
+
512
+ @override
513
+ def next_page_info(self) -> Optional[PageInfo]:
514
+ scenarios = self.scenarios
515
+ if not scenarios:
516
+ return None
517
+
518
+ item = cast(Any, scenarios[-1])
519
+ if not isinstance(item, ScenariosCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
520
+ # TODO emit warning log
521
+ return None
522
+
523
+ return PageInfo(params={"starting_after": item.id})
524
+
525
+
526
+ class AsyncScenariosCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
527
+ scenarios: List[_T]
528
+ has_more: Optional[bool] = None
529
+ total_count: Optional[int] = None
530
+
531
+ @override
532
+ def _get_page_items(self) -> List[_T]:
533
+ scenarios = self.scenarios
534
+ if not scenarios:
535
+ return []
536
+ return scenarios
537
+
538
+ @override
539
+ def has_next_page(self) -> bool:
540
+ has_more = self.has_more
541
+ if has_more is not None and has_more is False:
542
+ return False
543
+
544
+ return super().has_next_page()
545
+
546
+ @override
547
+ def next_page_info(self) -> Optional[PageInfo]:
548
+ scenarios = self.scenarios
549
+ if not scenarios:
550
+ return None
551
+
552
+ item = cast(Any, scenarios[-1])
553
+ if not isinstance(item, ScenariosCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
554
+ # TODO emit warning log
555
+ return None
556
+
557
+ return PageInfo(params={"starting_after": item.id})
558
+
559
+
560
+ class SyncScenarioRunsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
561
+ runs: List[_T]
562
+ has_more: Optional[bool] = None
563
+ total_count: Optional[int] = None
564
+
565
+ @override
566
+ def _get_page_items(self) -> List[_T]:
567
+ runs = self.runs
568
+ if not runs:
569
+ return []
570
+ return runs
571
+
572
+ @override
573
+ def has_next_page(self) -> bool:
574
+ has_more = self.has_more
575
+ if has_more is not None and has_more is False:
576
+ return False
577
+
578
+ return super().has_next_page()
579
+
580
+ @override
581
+ def next_page_info(self) -> Optional[PageInfo]:
582
+ runs = self.runs
583
+ if not runs:
584
+ return None
585
+
586
+ item = cast(Any, runs[-1])
587
+ if not isinstance(item, ScenarioRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
588
+ # TODO emit warning log
589
+ return None
590
+
591
+ return PageInfo(params={"starting_after": item.id})
592
+
593
+
594
+ class AsyncScenarioRunsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
595
+ runs: List[_T]
596
+ has_more: Optional[bool] = None
597
+ total_count: Optional[int] = None
598
+
599
+ @override
600
+ def _get_page_items(self) -> List[_T]:
601
+ runs = self.runs
602
+ if not runs:
603
+ return []
604
+ return runs
605
+
606
+ @override
607
+ def has_next_page(self) -> bool:
608
+ has_more = self.has_more
609
+ if has_more is not None and has_more is False:
610
+ return False
611
+
612
+ return super().has_next_page()
613
+
614
+ @override
615
+ def next_page_info(self) -> Optional[PageInfo]:
616
+ runs = self.runs
617
+ if not runs:
618
+ return None
619
+
620
+ item = cast(Any, runs[-1])
621
+ if not isinstance(item, ScenarioRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
622
+ # TODO emit warning log
623
+ return None
624
+
625
+ return PageInfo(params={"starting_after": item.id})
626
+
627
+
628
+ class SyncScenarioScorersCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
629
+ scorers: List[_T]
630
+ has_more: Optional[bool] = None
631
+ total_count: Optional[int] = None
632
+
633
+ @override
634
+ def _get_page_items(self) -> List[_T]:
635
+ scorers = self.scorers
636
+ if not scorers:
637
+ return []
638
+ return scorers
639
+
640
+ @override
641
+ def has_next_page(self) -> bool:
642
+ has_more = self.has_more
643
+ if has_more is not None and has_more is False:
644
+ return False
645
+
646
+ return super().has_next_page()
647
+
648
+ @override
649
+ def next_page_info(self) -> Optional[PageInfo]:
650
+ scorers = self.scorers
651
+ if not scorers:
652
+ return None
653
+
654
+ item = cast(Any, scorers[-1])
655
+ if not isinstance(item, ScenarioScorersCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
656
+ # TODO emit warning log
657
+ return None
658
+
659
+ return PageInfo(params={"starting_after": item.id})
660
+
661
+
662
+ class AsyncScenarioScorersCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
663
+ scorers: List[_T]
664
+ has_more: Optional[bool] = None
665
+ total_count: Optional[int] = None
666
+
667
+ @override
668
+ def _get_page_items(self) -> List[_T]:
669
+ scorers = self.scorers
670
+ if not scorers:
671
+ return []
672
+ return scorers
673
+
674
+ @override
675
+ def has_next_page(self) -> bool:
676
+ has_more = self.has_more
677
+ if has_more is not None and has_more is False:
678
+ return False
679
+
680
+ return super().has_next_page()
681
+
682
+ @override
683
+ def next_page_info(self) -> Optional[PageInfo]:
684
+ scorers = self.scorers
685
+ if not scorers:
686
+ return None
687
+
688
+ item = cast(Any, scorers[-1])
689
+ if not isinstance(item, ScenarioScorersCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
690
+ # TODO emit warning log
691
+ return None
692
+
693
+ return PageInfo(params={"starting_after": item.id})
694
+
695
+
696
+ class SyncObjectsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
697
+ objects: List[_T]
698
+ has_more: Optional[bool] = None
699
+ total_count: Optional[int] = None
700
+
701
+ @override
702
+ def _get_page_items(self) -> List[_T]:
703
+ objects = self.objects
704
+ if not objects:
705
+ return []
706
+ return objects
707
+
708
+ @override
709
+ def has_next_page(self) -> bool:
710
+ has_more = self.has_more
711
+ if has_more is not None and has_more is False:
712
+ return False
713
+
714
+ return super().has_next_page()
715
+
716
+ @override
717
+ def next_page_info(self) -> Optional[PageInfo]:
718
+ objects = self.objects
719
+ if not objects:
720
+ return None
721
+
722
+ item = cast(Any, objects[-1])
723
+ if not isinstance(item, ObjectsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
724
+ # TODO emit warning log
725
+ return None
726
+
727
+ return PageInfo(params={"starting_after": item.id})
728
+
729
+
730
+ class AsyncObjectsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
731
+ objects: List[_T]
732
+ has_more: Optional[bool] = None
733
+ total_count: Optional[int] = None
734
+
735
+ @override
736
+ def _get_page_items(self) -> List[_T]:
737
+ objects = self.objects
738
+ if not objects:
739
+ return []
740
+ return objects
741
+
742
+ @override
743
+ def has_next_page(self) -> bool:
744
+ has_more = self.has_more
745
+ if has_more is not None and has_more is False:
746
+ return False
747
+
748
+ return super().has_next_page()
749
+
750
+ @override
751
+ def next_page_info(self) -> Optional[PageInfo]:
752
+ objects = self.objects
753
+ if not objects:
754
+ return None
755
+
756
+ item = cast(Any, objects[-1])
757
+ if not isinstance(item, ObjectsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison]
758
+ # TODO emit warning log
759
+ return None
760
+
761
+ return PageInfo(params={"starting_after": item.id})