docket-client 0.3.2__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 (188) hide show
  1. docket/__init__.py +8 -0
  2. docket/api/__init__.py +1 -0
  3. docket/api/access/__init__.py +1 -0
  4. docket/api/access/add_principal.py +193 -0
  5. docket/api/access/archive_role_assignment.py +182 -0
  6. docket/api/access/create_api_token.py +198 -0
  7. docket/api/access/create_application_principal.py +188 -0
  8. docket/api/access/create_role_assignment.py +194 -0
  9. docket/api/access/list_api_tokens.py +184 -0
  10. docket/api/access/list_principals.py +184 -0
  11. docket/api/access/list_role_assignments.py +200 -0
  12. docket/api/access/revoke_api_token.py +173 -0
  13. docket/api/identity/__init__.py +1 -0
  14. docket/api/identity/create_my_api_token.py +206 -0
  15. docket/api/identity/get_me.py +127 -0
  16. docket/api/identity/list_my_api_tokens.py +151 -0
  17. docket/api/identity/revoke_my_api_token.py +178 -0
  18. docket/api/recurring_acquisitions/__init__.py +1 -0
  19. docket/api/recurring_acquisitions/archive_recurring_acquisition.py +207 -0
  20. docket/api/recurring_acquisitions/create_recurring_acquisition.py +218 -0
  21. docket/api/recurring_acquisitions/get_recurring_acquisition.py +163 -0
  22. docket/api/recurring_acquisitions/list_recurring_acquisitions.py +248 -0
  23. docket/api/recurring_acquisitions/preview_recurring_acquisition.py +187 -0
  24. docket/api/recurring_acquisitions/preview_split_recurring_acquisition.py +232 -0
  25. docket/api/recurring_acquisitions/split_recurring_acquisition.py +258 -0
  26. docket/api/runs/__init__.py +1 -0
  27. docket/api/runs/get_run.py +160 -0
  28. docket/api/runs/list_runs.py +180 -0
  29. docket/api/runs/report_run_outcome.py +206 -0
  30. docket/api/scheduled_acquisitions/__init__.py +1 -0
  31. docket/api/scheduled_acquisitions/archive_scheduled_acquisition.py +203 -0
  32. docket/api/scheduled_acquisitions/create_scheduled_acquisition.py +185 -0
  33. docket/api/scheduled_acquisitions/get_resolved_settings.py +169 -0
  34. docket/api/scheduled_acquisitions/get_scheduled_acquisition.py +159 -0
  35. docket/api/scheduled_acquisitions/list_active_acquisitions.py +297 -0
  36. docket/api/scheduled_acquisitions/list_runs_for_scheduled_acquisition.py +191 -0
  37. docket/api/scheduled_acquisitions/list_scheduled_acquisitions.py +332 -0
  38. docket/api/scheduled_acquisitions/preview_scheduled_acquisition_edit.py +224 -0
  39. docket/api/scheduled_acquisitions/set_planning_status.py +199 -0
  40. docket/api/scheduled_acquisitions/start_run.py +221 -0
  41. docket/api/scheduled_acquisitions/update_scheduled_acquisition.py +226 -0
  42. docket/api/settings/__init__.py +1 -0
  43. docket/api/settings/list_behavior_curriculum_discriminator_values.py +188 -0
  44. docket/api/settings/list_behavior_curriculum_settings.py +199 -0
  45. docket/api/settings/list_fip_discriminator_values.py +184 -0
  46. docket/api/settings/list_fip_settings.py +195 -0
  47. docket/api/settings/list_live_behavior_curriculum_settings.py +233 -0
  48. docket/api/settings/list_live_fip_settings.py +225 -0
  49. docket/api/settings/preview_behavior_curriculum_settings.py +191 -0
  50. docket/api/settings/preview_fip_settings.py +177 -0
  51. docket/api/settings/push_behavior_curriculum_settings.py +222 -0
  52. docket/api/settings/push_fip_settings.py +206 -0
  53. docket/api/templates/__init__.py +1 -0
  54. docket/api/templates/archive_template.py +203 -0
  55. docket/api/templates/create_template.py +206 -0
  56. docket/api/templates/get_template.py +159 -0
  57. docket/api/templates/list_templates.py +174 -0
  58. docket/api/templates/update_template.py +234 -0
  59. docket/api/vocabulary/__init__.py +1 -0
  60. docket/api/vocabulary/list_instruments.py +165 -0
  61. docket/api/vocabulary/list_persons.py +132 -0
  62. docket/api/vocabulary/list_projects.py +132 -0
  63. docket/api/vocabulary/list_subjects.py +132 -0
  64. docket/api/vocabulary/lookup_person.py +166 -0
  65. docket/api/vocabulary/lookup_subject.py +166 -0
  66. docket/api/vocabulary/sync_vocabulary.py +148 -0
  67. docket/client.py +272 -0
  68. docket/errors.py +16 -0
  69. docket/models/__init__.py +221 -0
  70. docket/models/access_role.py +12 -0
  71. docket/models/access_role_nullable_type_1.py +12 -0
  72. docket/models/access_role_nullable_type_2_type_1.py +12 -0
  73. docket/models/access_role_nullable_type_3_type_1.py +12 -0
  74. docket/models/acquisition_variable.py +72 -0
  75. docket/models/acquisition_warning.py +126 -0
  76. docket/models/add_principal_request.py +83 -0
  77. docket/models/api_token_response.py +271 -0
  78. docket/models/api_token_status.py +10 -0
  79. docket/models/archive_recurring_acquisition_request.py +77 -0
  80. docket/models/archive_recurring_acquisition_response.py +83 -0
  81. docket/models/archive_scheduled_acquisition_request.py +78 -0
  82. docket/models/archive_template_request.py +66 -0
  83. docket/models/auth_mode.py +10 -0
  84. docket/models/behavior_curriculum_push_settings_request.py +85 -0
  85. docket/models/behavior_curriculum_settings.py +55 -0
  86. docket/models/behavior_curriculum_settings_preview_response.py +102 -0
  87. docket/models/behavior_curriculum_settings_preview_response_promoted.py +50 -0
  88. docket/models/behavior_curriculum_settings_version_response.py +160 -0
  89. docket/models/behavior_curriculum_settings_version_response_promoted.py +50 -0
  90. docket/models/caller_kind.py +11 -0
  91. docket/models/create_api_token_request.py +97 -0
  92. docket/models/create_application_principal_request.py +65 -0
  93. docket/models/create_personal_api_token_request.py +167 -0
  94. docket/models/create_recurring_acquisition_request.py +269 -0
  95. docket/models/create_role_assignment_request.py +99 -0
  96. docket/models/create_scheduled_acquisition_request.py +265 -0
  97. docket/models/create_template_request.py +323 -0
  98. docket/models/created_api_token_response.py +82 -0
  99. docket/models/effective_status.py +15 -0
  100. docket/models/fip_color.py +13 -0
  101. docket/models/fip_fiber.py +93 -0
  102. docket/models/fip_mode.py +9 -0
  103. docket/models/fip_push_settings_request.py +82 -0
  104. docket/models/fip_settings.py +91 -0
  105. docket/models/fip_settings_preview_response.py +97 -0
  106. docket/models/fip_settings_preview_response_promoted.py +50 -0
  107. docket/models/fip_settings_version_response.py +155 -0
  108. docket/models/fip_settings_version_response_promoted.py +50 -0
  109. docket/models/future_occurrences.py +9 -0
  110. docket/models/get_resolved_settings_response_200.py +65 -0
  111. docket/models/held_role_response.py +116 -0
  112. docket/models/http_validation_problem_details.py +204 -0
  113. docket/models/http_validation_problem_details_errors.py +59 -0
  114. docket/models/instrument_response.py +91 -0
  115. docket/models/kept_occurrence.py +85 -0
  116. docket/models/kept_occurrence_reason.py +10 -0
  117. docket/models/list_active_acquisitions_effective_status_item.py +15 -0
  118. docket/models/list_scheduled_acquisitions_planning_status.py +11 -0
  119. docket/models/me_caller.py +118 -0
  120. docket/models/me_permission.py +98 -0
  121. docket/models/me_response.py +158 -0
  122. docket/models/me_role.py +75 -0
  123. docket/models/occurrence_preview.py +121 -0
  124. docket/models/occurrence_summary.py +126 -0
  125. docket/models/occurrence_warnings.py +91 -0
  126. docket/models/permission_action.py +12 -0
  127. docket/models/person_assignment.py +74 -0
  128. docket/models/person_lookup_response.py +131 -0
  129. docket/models/person_response.py +103 -0
  130. docket/models/person_role.py +9 -0
  131. docket/models/personal_token_limits.py +92 -0
  132. docket/models/planning_status.py +11 -0
  133. docket/models/principal_kind.py +9 -0
  134. docket/models/principal_response.py +216 -0
  135. docket/models/problem_details.py +177 -0
  136. docket/models/project_response.py +75 -0
  137. docket/models/recurrence_exception_kind.py +13 -0
  138. docket/models/recurrence_exception_response.py +103 -0
  139. docket/models/recurrence_frequency.py +9 -0
  140. docket/models/recurrence_preview_response.py +101 -0
  141. docket/models/recurrence_rule.py +207 -0
  142. docket/models/recurring_acquisition_created_response.py +123 -0
  143. docket/models/recurring_acquisition_detail_response.py +105 -0
  144. docket/models/recurring_acquisition_response.py +326 -0
  145. docket/models/report_run_outcome_request.py +89 -0
  146. docket/models/resolution_mode.py +10 -0
  147. docket/models/resolved_settings.py +73 -0
  148. docket/models/role_assignment_response.py +157 -0
  149. docket/models/role_origin.py +10 -0
  150. docket/models/role_source_kind.py +10 -0
  151. docket/models/run_origin.py +9 -0
  152. docket/models/run_outcome.py +9 -0
  153. docket/models/run_response.py +181 -0
  154. docket/models/run_settings_snapshot.py +72 -0
  155. docket/models/run_start_response.py +91 -0
  156. docket/models/run_start_response_settings.py +65 -0
  157. docket/models/run_status.py +11 -0
  158. docket/models/scheduled_acquisition_edit_preview_response.py +150 -0
  159. docket/models/scheduled_acquisition_response.py +366 -0
  160. docket/models/set_planning_status_request.py +90 -0
  161. docket/models/settings_selector.py +138 -0
  162. docket/models/skipped_occurrence.py +85 -0
  163. docket/models/split_preview_response.py +129 -0
  164. docket/models/split_recurring_acquisition_request.py +261 -0
  165. docket/models/split_recurring_acquisition_response.py +159 -0
  166. docket/models/start_run_request.py +73 -0
  167. docket/models/subject_lookup_response.py +149 -0
  168. docket/models/subject_response.py +128 -0
  169. docket/models/sync_counts.py +80 -0
  170. docket/models/sync_response.py +81 -0
  171. docket/models/template_response.py +302 -0
  172. docket/models/update_scheduled_acquisition_request.py +235 -0
  173. docket/models/update_template_request.py +279 -0
  174. docket/models/weekday.py +14 -0
  175. docket/types.py +54 -0
  176. docket_auth/__init__.py +239 -0
  177. docket_client-0.3.2.dist-info/METADATA +233 -0
  178. docket_client-0.3.2.dist-info/RECORD +188 -0
  179. docket_client-0.3.2.dist-info/WHEEL +4 -0
  180. docket_client-0.3.2.dist-info/entry_points.txt +2 -0
  181. docket_mcp/__init__.py +6 -0
  182. docket_mcp/api.py +207 -0
  183. docket_mcp/config.py +57 -0
  184. docket_mcp/server.py +78 -0
  185. docket_mcp/signin.py +155 -0
  186. docket_mcp/slots.py +80 -0
  187. docket_mcp/times.py +160 -0
  188. docket_mcp/tools.py +1202 -0
@@ -0,0 +1,258 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response, UNSET
9
+ from ... import errors
10
+
11
+ from ...models.http_validation_problem_details import HttpValidationProblemDetails
12
+ from ...models.problem_details import ProblemDetails
13
+ from ...models.split_recurring_acquisition_request import SplitRecurringAcquisitionRequest
14
+ from ...models.split_recurring_acquisition_response import SplitRecurringAcquisitionResponse
15
+ from ...types import UNSET, Unset
16
+ from typing import cast
17
+
18
+
19
+ def _get_kwargs(
20
+ id: int,
21
+ *,
22
+ body: SplitRecurringAcquisitionRequest,
23
+ idempotency_key: str | Unset = UNSET,
24
+ ) -> dict[str, Any]:
25
+ headers: dict[str, Any] = {}
26
+ if not isinstance(idempotency_key, Unset):
27
+ headers["Idempotency-Key"] = idempotency_key
28
+
29
+ _kwargs: dict[str, Any] = {
30
+ "method": "post",
31
+ "url": "/api/v1/recurring-acquisitions/{id}/split".format(
32
+ id=quote(str(id), safe=""),
33
+ ),
34
+ }
35
+
36
+ _kwargs["json"] = body.to_dict()
37
+
38
+ headers["Content-Type"] = "application/json"
39
+
40
+ _kwargs["headers"] = headers
41
+ return _kwargs
42
+
43
+
44
+ def _parse_response(
45
+ *, client: AuthenticatedClient | Client, response: httpx.Response
46
+ ) -> HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse | None:
47
+ if response.status_code == 201:
48
+ response_201 = SplitRecurringAcquisitionResponse.from_dict(response.json())
49
+
50
+ return response_201
51
+
52
+ if response.status_code == 401:
53
+ response_401 = ProblemDetails.from_dict(response.json())
54
+
55
+ return response_401
56
+
57
+ if response.status_code == 403:
58
+ response_403 = ProblemDetails.from_dict(response.json())
59
+
60
+ return response_403
61
+
62
+ if response.status_code == 404:
63
+ response_404 = ProblemDetails.from_dict(response.json())
64
+
65
+ return response_404
66
+
67
+ if response.status_code == 409:
68
+ response_409 = ProblemDetails.from_dict(response.json())
69
+
70
+ return response_409
71
+
72
+ if response.status_code == 422:
73
+ response_422 = HttpValidationProblemDetails.from_dict(response.json())
74
+
75
+ return response_422
76
+
77
+ if response.status_code == 503:
78
+ response_503 = ProblemDetails.from_dict(response.json())
79
+
80
+ return response_503
81
+
82
+ if client.raise_on_unexpected_status:
83
+ raise errors.UnexpectedStatus(response.status_code, response.content)
84
+ else:
85
+ return None
86
+
87
+
88
+ def _build_response(
89
+ *, client: AuthenticatedClient | Client, response: httpx.Response
90
+ ) -> Response[HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse]:
91
+ return Response(
92
+ status_code=HTTPStatus(response.status_code),
93
+ content=response.content,
94
+ headers=response.headers,
95
+ parsed=_parse_response(client=client, response=response),
96
+ )
97
+
98
+
99
+ def sync_detailed(
100
+ id: int,
101
+ *,
102
+ client: AuthenticatedClient,
103
+ body: SplitRecurringAcquisitionRequest,
104
+ idempotency_key: str | Unset = UNSET,
105
+ ) -> Response[HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse]:
106
+ """Edit a series from a date onward: end this series the day before effective_date and create a new one
107
+ from it, in one transaction. Old occurrences from effective_date that have no runs and were not
108
+ edited are archived; the others stay. Retry-safe with an Idempotency-Key.
109
+
110
+ Args:
111
+ id (int):
112
+ idempotency_key (str | Unset):
113
+ body (SplitRecurringAcquisitionRequest): Edit a series from a date onward: end the old
114
+ series the day before
115
+ `effective_date` and start a new one from it. Carries the complete new definition (the
116
+ same fields as
117
+ CreateRecurringAcquisitionRequest), not a patch; clients prefill it from the old one.
118
+ `rule.start_date` must equal `effective_date`. For a `count` rule, `count` is the number
119
+ of occurrences of the new part.
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ id=id,
131
+ body=body,
132
+ idempotency_key=idempotency_key,
133
+ )
134
+
135
+ response = client.get_httpx_client().request(
136
+ **kwargs,
137
+ )
138
+
139
+ return _build_response(client=client, response=response)
140
+
141
+
142
+ def sync(
143
+ id: int,
144
+ *,
145
+ client: AuthenticatedClient,
146
+ body: SplitRecurringAcquisitionRequest,
147
+ idempotency_key: str | Unset = UNSET,
148
+ ) -> HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse | None:
149
+ """Edit a series from a date onward: end this series the day before effective_date and create a new one
150
+ from it, in one transaction. Old occurrences from effective_date that have no runs and were not
151
+ edited are archived; the others stay. Retry-safe with an Idempotency-Key.
152
+
153
+ Args:
154
+ id (int):
155
+ idempotency_key (str | Unset):
156
+ body (SplitRecurringAcquisitionRequest): Edit a series from a date onward: end the old
157
+ series the day before
158
+ `effective_date` and start a new one from it. Carries the complete new definition (the
159
+ same fields as
160
+ CreateRecurringAcquisitionRequest), not a patch; clients prefill it from the old one.
161
+ `rule.start_date` must equal `effective_date`. For a `count` rule, `count` is the number
162
+ of occurrences of the new part.
163
+
164
+ Raises:
165
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
166
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
167
+
168
+ Returns:
169
+ HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse
170
+ """
171
+
172
+ return sync_detailed(
173
+ id=id,
174
+ client=client,
175
+ body=body,
176
+ idempotency_key=idempotency_key,
177
+ ).parsed
178
+
179
+
180
+ async def asyncio_detailed(
181
+ id: int,
182
+ *,
183
+ client: AuthenticatedClient,
184
+ body: SplitRecurringAcquisitionRequest,
185
+ idempotency_key: str | Unset = UNSET,
186
+ ) -> Response[HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse]:
187
+ """Edit a series from a date onward: end this series the day before effective_date and create a new one
188
+ from it, in one transaction. Old occurrences from effective_date that have no runs and were not
189
+ edited are archived; the others stay. Retry-safe with an Idempotency-Key.
190
+
191
+ Args:
192
+ id (int):
193
+ idempotency_key (str | Unset):
194
+ body (SplitRecurringAcquisitionRequest): Edit a series from a date onward: end the old
195
+ series the day before
196
+ `effective_date` and start a new one from it. Carries the complete new definition (the
197
+ same fields as
198
+ CreateRecurringAcquisitionRequest), not a patch; clients prefill it from the old one.
199
+ `rule.start_date` must equal `effective_date`. For a `count` rule, `count` is the number
200
+ of occurrences of the new part.
201
+
202
+ Raises:
203
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
204
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
205
+
206
+ Returns:
207
+ Response[HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse]
208
+ """
209
+
210
+ kwargs = _get_kwargs(
211
+ id=id,
212
+ body=body,
213
+ idempotency_key=idempotency_key,
214
+ )
215
+
216
+ response = await client.get_async_httpx_client().request(**kwargs)
217
+
218
+ return _build_response(client=client, response=response)
219
+
220
+
221
+ async def asyncio(
222
+ id: int,
223
+ *,
224
+ client: AuthenticatedClient,
225
+ body: SplitRecurringAcquisitionRequest,
226
+ idempotency_key: str | Unset = UNSET,
227
+ ) -> HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse | None:
228
+ """Edit a series from a date onward: end this series the day before effective_date and create a new one
229
+ from it, in one transaction. Old occurrences from effective_date that have no runs and were not
230
+ edited are archived; the others stay. Retry-safe with an Idempotency-Key.
231
+
232
+ Args:
233
+ id (int):
234
+ idempotency_key (str | Unset):
235
+ body (SplitRecurringAcquisitionRequest): Edit a series from a date onward: end the old
236
+ series the day before
237
+ `effective_date` and start a new one from it. Carries the complete new definition (the
238
+ same fields as
239
+ CreateRecurringAcquisitionRequest), not a patch; clients prefill it from the old one.
240
+ `rule.start_date` must equal `effective_date`. For a `count` rule, `count` is the number
241
+ of occurrences of the new part.
242
+
243
+ Raises:
244
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
245
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
246
+
247
+ Returns:
248
+ HttpValidationProblemDetails | ProblemDetails | SplitRecurringAcquisitionResponse
249
+ """
250
+
251
+ return (
252
+ await asyncio_detailed(
253
+ id=id,
254
+ client=client,
255
+ body=body,
256
+ idempotency_key=idempotency_key,
257
+ )
258
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,160 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response, UNSET
9
+ from ... import errors
10
+
11
+ from ...models.problem_details import ProblemDetails
12
+ from ...models.run_response import RunResponse
13
+ from typing import cast
14
+ from uuid import UUID
15
+
16
+
17
+ def _get_kwargs(
18
+ token: UUID,
19
+ ) -> dict[str, Any]:
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "get",
23
+ "url": "/api/v1/runs/{token}".format(
24
+ token=quote(str(token), safe=""),
25
+ ),
26
+ }
27
+
28
+ return _kwargs
29
+
30
+
31
+ def _parse_response(
32
+ *, client: AuthenticatedClient | Client, response: httpx.Response
33
+ ) -> ProblemDetails | RunResponse | None:
34
+ if response.status_code == 200:
35
+ response_200 = RunResponse.from_dict(response.json())
36
+
37
+ return response_200
38
+
39
+ if response.status_code == 404:
40
+ response_404 = ProblemDetails.from_dict(response.json())
41
+
42
+ return response_404
43
+
44
+ if client.raise_on_unexpected_status:
45
+ raise errors.UnexpectedStatus(response.status_code, response.content)
46
+ else:
47
+ return None
48
+
49
+
50
+ def _build_response(
51
+ *, client: AuthenticatedClient | Client, response: httpx.Response
52
+ ) -> Response[ProblemDetails | RunResponse]:
53
+ return Response(
54
+ status_code=HTTPStatus(response.status_code),
55
+ content=response.content,
56
+ headers=response.headers,
57
+ parsed=_parse_response(client=client, response=response),
58
+ )
59
+
60
+
61
+ def sync_detailed(
62
+ token: UUID,
63
+ *,
64
+ client: AuthenticatedClient,
65
+ ) -> Response[ProblemDetails | RunResponse]:
66
+ """
67
+ Args:
68
+ token (UUID):
69
+
70
+ Raises:
71
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
72
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
73
+
74
+ Returns:
75
+ Response[ProblemDetails | RunResponse]
76
+ """
77
+
78
+ kwargs = _get_kwargs(
79
+ token=token,
80
+ )
81
+
82
+ response = client.get_httpx_client().request(
83
+ **kwargs,
84
+ )
85
+
86
+ return _build_response(client=client, response=response)
87
+
88
+
89
+ def sync(
90
+ token: UUID,
91
+ *,
92
+ client: AuthenticatedClient,
93
+ ) -> ProblemDetails | RunResponse | None:
94
+ """
95
+ Args:
96
+ token (UUID):
97
+
98
+ Raises:
99
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
100
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
101
+
102
+ Returns:
103
+ ProblemDetails | RunResponse
104
+ """
105
+
106
+ return sync_detailed(
107
+ token=token,
108
+ client=client,
109
+ ).parsed
110
+
111
+
112
+ async def asyncio_detailed(
113
+ token: UUID,
114
+ *,
115
+ client: AuthenticatedClient,
116
+ ) -> Response[ProblemDetails | RunResponse]:
117
+ """
118
+ Args:
119
+ token (UUID):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[ProblemDetails | RunResponse]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ token=token,
131
+ )
132
+
133
+ response = await client.get_async_httpx_client().request(**kwargs)
134
+
135
+ return _build_response(client=client, response=response)
136
+
137
+
138
+ async def asyncio(
139
+ token: UUID,
140
+ *,
141
+ client: AuthenticatedClient,
142
+ ) -> ProblemDetails | RunResponse | None:
143
+ """
144
+ Args:
145
+ token (UUID):
146
+
147
+ Raises:
148
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
149
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
150
+
151
+ Returns:
152
+ ProblemDetails | RunResponse
153
+ """
154
+
155
+ return (
156
+ await asyncio_detailed(
157
+ token=token,
158
+ client=client,
159
+ )
160
+ ).parsed
@@ -0,0 +1,180 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response, UNSET
9
+ from ... import errors
10
+
11
+ from ...models.http_validation_problem_details import HttpValidationProblemDetails
12
+ from ...models.run_response import RunResponse
13
+ from ...types import UNSET, Unset
14
+ from typing import cast
15
+
16
+
17
+ def _get_kwargs(
18
+ *,
19
+ limit: int | None | Unset = UNSET,
20
+ ) -> dict[str, Any]:
21
+
22
+ params: dict[str, Any] = {}
23
+
24
+ json_limit: int | None | Unset
25
+ if isinstance(limit, Unset):
26
+ json_limit = UNSET
27
+ else:
28
+ json_limit = limit
29
+ params["limit"] = json_limit
30
+
31
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
32
+
33
+ _kwargs: dict[str, Any] = {
34
+ "method": "get",
35
+ "url": "/api/v1/runs",
36
+ "params": params,
37
+ }
38
+
39
+ return _kwargs
40
+
41
+
42
+ def _parse_response(
43
+ *, client: AuthenticatedClient | Client, response: httpx.Response
44
+ ) -> HttpValidationProblemDetails | list[RunResponse] | None:
45
+ if response.status_code == 200:
46
+ response_200 = []
47
+ _response_200 = response.json()
48
+ for response_200_item_data in _response_200:
49
+ response_200_item = RunResponse.from_dict(response_200_item_data)
50
+
51
+ response_200.append(response_200_item)
52
+
53
+ return response_200
54
+
55
+ if response.status_code == 422:
56
+ response_422 = HttpValidationProblemDetails.from_dict(response.json())
57
+
58
+ return response_422
59
+
60
+ if client.raise_on_unexpected_status:
61
+ raise errors.UnexpectedStatus(response.status_code, response.content)
62
+ else:
63
+ return None
64
+
65
+
66
+ def _build_response(
67
+ *, client: AuthenticatedClient | Client, response: httpx.Response
68
+ ) -> Response[HttpValidationProblemDetails | list[RunResponse]]:
69
+ return Response(
70
+ status_code=HTTPStatus(response.status_code),
71
+ content=response.content,
72
+ headers=response.headers,
73
+ parsed=_parse_response(client=client, response=response),
74
+ )
75
+
76
+
77
+ def sync_detailed(
78
+ *,
79
+ client: AuthenticatedClient,
80
+ limit: int | None | Unset = UNSET,
81
+ ) -> Response[HttpValidationProblemDetails | list[RunResponse]]:
82
+ """Runs, newest first.
83
+
84
+ Args:
85
+ limit (int | None | Unset):
86
+
87
+ Raises:
88
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
89
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
90
+
91
+ Returns:
92
+ Response[HttpValidationProblemDetails | list[RunResponse]]
93
+ """
94
+
95
+ kwargs = _get_kwargs(
96
+ limit=limit,
97
+ )
98
+
99
+ response = client.get_httpx_client().request(
100
+ **kwargs,
101
+ )
102
+
103
+ return _build_response(client=client, response=response)
104
+
105
+
106
+ def sync(
107
+ *,
108
+ client: AuthenticatedClient,
109
+ limit: int | None | Unset = UNSET,
110
+ ) -> HttpValidationProblemDetails | list[RunResponse] | None:
111
+ """Runs, newest first.
112
+
113
+ Args:
114
+ limit (int | None | Unset):
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ HttpValidationProblemDetails | list[RunResponse]
122
+ """
123
+
124
+ return sync_detailed(
125
+ client=client,
126
+ limit=limit,
127
+ ).parsed
128
+
129
+
130
+ async def asyncio_detailed(
131
+ *,
132
+ client: AuthenticatedClient,
133
+ limit: int | None | Unset = UNSET,
134
+ ) -> Response[HttpValidationProblemDetails | list[RunResponse]]:
135
+ """Runs, newest first.
136
+
137
+ Args:
138
+ limit (int | None | Unset):
139
+
140
+ Raises:
141
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
142
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
143
+
144
+ Returns:
145
+ Response[HttpValidationProblemDetails | list[RunResponse]]
146
+ """
147
+
148
+ kwargs = _get_kwargs(
149
+ limit=limit,
150
+ )
151
+
152
+ response = await client.get_async_httpx_client().request(**kwargs)
153
+
154
+ return _build_response(client=client, response=response)
155
+
156
+
157
+ async def asyncio(
158
+ *,
159
+ client: AuthenticatedClient,
160
+ limit: int | None | Unset = UNSET,
161
+ ) -> HttpValidationProblemDetails | list[RunResponse] | None:
162
+ """Runs, newest first.
163
+
164
+ Args:
165
+ limit (int | None | Unset):
166
+
167
+ Raises:
168
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
169
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
170
+
171
+ Returns:
172
+ HttpValidationProblemDetails | list[RunResponse]
173
+ """
174
+
175
+ return (
176
+ await asyncio_detailed(
177
+ client=client,
178
+ limit=limit,
179
+ )
180
+ ).parsed