blaxel 0.2.29__py3-none-any.whl → 0.2.31__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 (185) hide show
  1. blaxel/__init__.py +3 -3
  2. blaxel/core/agents/__init__.py +13 -6
  3. blaxel/core/authentication/__init__.py +2 -1
  4. blaxel/core/authentication/devicemode.py +9 -1
  5. blaxel/core/authentication/oauth.py +13 -6
  6. blaxel/core/authentication/types.py +1 -0
  7. blaxel/core/cache/cache.py +10 -3
  8. blaxel/core/client/api/agents/list_agent_revisions.py +3 -1
  9. blaxel/core/client/api/compute/delete_sandbox_preview_token.py +6 -2
  10. blaxel/core/client/api/compute/start_sandbox.py +3 -1
  11. blaxel/core/client/api/compute/stop_sandbox.py +3 -1
  12. blaxel/core/client/api/default/list_sandbox_hub_definitions.py +6 -2
  13. blaxel/core/client/api/functions/list_function_revisions.py +3 -1
  14. blaxel/core/client/api/images/cleanup_images.py +3 -1
  15. blaxel/core/client/api/integrations/list_integration_connections.py +6 -2
  16. blaxel/core/client/api/invitations/list_all_pending_invitations.py +3 -1
  17. blaxel/core/client/api/jobs/create_job_execution.py +3 -1
  18. blaxel/core/client/api/jobs/delete_job_execution.py +3 -1
  19. blaxel/core/client/api/jobs/get_job_execution.py +3 -1
  20. blaxel/core/client/api/jobs/list_job_executions.py +6 -2
  21. blaxel/core/client/api/jobs/list_job_revisions.py +3 -1
  22. blaxel/core/client/api/locations/list_locations.py +3 -1
  23. blaxel/core/client/api/models/list_model_revisions.py +3 -1
  24. blaxel/core/client/api/service_accounts/create_workspace_service_account.py +6 -2
  25. blaxel/core/client/api/service_accounts/delete_workspace_service_account.py +6 -2
  26. blaxel/core/client/api/service_accounts/get_workspace_service_accounts.py +3 -1
  27. blaxel/core/client/api/service_accounts/update_workspace_service_account.py +6 -2
  28. blaxel/core/client/api/volume_templates/list_volume_templates.py +3 -1
  29. blaxel/core/client/api/workspaces/accept_workspace_invitation.py +6 -2
  30. blaxel/core/client/api/workspaces/invite_workspace_user.py +6 -2
  31. blaxel/core/client/api/workspaces/update_workspace_user_role.py +6 -2
  32. blaxel/core/client/client.py +3 -1
  33. blaxel/core/client/models/agent.py +11 -4
  34. blaxel/core/client/models/agent_spec.py +18 -5
  35. blaxel/core/client/models/billable_time_metric.py +0 -1
  36. blaxel/core/client/models/configuration.py +0 -1
  37. blaxel/core/client/models/core_spec.py +10 -3
  38. blaxel/core/client/models/core_spec_configurations.py +0 -1
  39. blaxel/core/client/models/create_job_execution_request.py +0 -1
  40. blaxel/core/client/models/create_job_execution_response.py +0 -1
  41. blaxel/core/client/models/custom_domain.py +5 -2
  42. blaxel/core/client/models/custom_domain_metadata.py +0 -1
  43. blaxel/core/client/models/custom_domain_spec.py +5 -2
  44. blaxel/core/client/models/delete_volume_template_version_response_200.py +5 -2
  45. blaxel/core/client/models/entrypoint.py +0 -1
  46. blaxel/core/client/models/form.py +5 -2
  47. blaxel/core/client/models/function.py +11 -4
  48. blaxel/core/client/models/function_spec.py +13 -4
  49. blaxel/core/client/models/image.py +5 -2
  50. blaxel/core/client/models/image_spec.py +0 -1
  51. blaxel/core/client/models/integration.py +10 -3
  52. blaxel/core/client/models/integration_connection.py +5 -2
  53. blaxel/core/client/models/integration_connection_spec.py +0 -1
  54. blaxel/core/client/models/integration_endpoint.py +5 -2
  55. blaxel/core/client/models/integration_endpoints.py +0 -2
  56. blaxel/core/client/models/job.py +11 -4
  57. blaxel/core/client/models/job_execution.py +5 -2
  58. blaxel/core/client/models/job_execution_spec.py +0 -1
  59. blaxel/core/client/models/job_execution_task.py +5 -2
  60. blaxel/core/client/models/job_metrics.py +5 -2
  61. blaxel/core/client/models/job_spec.py +13 -4
  62. blaxel/core/client/models/jobs_network_chart.py +0 -1
  63. blaxel/core/client/models/jobs_success_failed_chart.py +10 -3
  64. blaxel/core/client/models/latency_metric.py +5 -2
  65. blaxel/core/client/models/location_response.py +0 -1
  66. blaxel/core/client/models/mcp_definition.py +5 -2
  67. blaxel/core/client/models/metadata.py +0 -1
  68. blaxel/core/client/models/metrics.py +11 -4
  69. blaxel/core/client/models/model.py +11 -4
  70. blaxel/core/client/models/model_spec.py +10 -3
  71. blaxel/core/client/models/pending_invitation_accept.py +5 -2
  72. blaxel/core/client/models/pending_invitation_render.py +10 -3
  73. blaxel/core/client/models/policy.py +5 -2
  74. blaxel/core/client/models/policy_spec.py +11 -4
  75. blaxel/core/client/models/preview.py +5 -2
  76. blaxel/core/client/models/preview_spec.py +0 -1
  77. blaxel/core/client/models/preview_token.py +5 -2
  78. blaxel/core/client/models/public_ips.py +0 -1
  79. blaxel/core/client/models/request_duration_over_time_metrics.py +0 -1
  80. blaxel/core/client/models/request_total_by_origin_metric.py +16 -7
  81. blaxel/core/client/models/request_total_metric.py +8 -3
  82. blaxel/core/client/models/resource_metrics.py +58 -17
  83. blaxel/core/client/models/runtime.py +0 -1
  84. blaxel/core/client/models/sandbox.py +11 -4
  85. blaxel/core/client/models/sandbox_definition.py +0 -1
  86. blaxel/core/client/models/sandbox_lifecycle.py +0 -1
  87. blaxel/core/client/models/sandbox_spec.py +21 -6
  88. blaxel/core/client/models/serverless_config.py +0 -1
  89. blaxel/core/client/models/start_sandbox.py +5 -2
  90. blaxel/core/client/models/stop_sandbox.py +5 -2
  91. blaxel/core/client/models/store_agent.py +0 -1
  92. blaxel/core/client/models/store_configuration.py +0 -1
  93. blaxel/core/client/models/template.py +0 -1
  94. blaxel/core/client/models/time_to_first_token_over_time_metrics.py +3 -2
  95. blaxel/core/client/models/token_rate_metrics.py +0 -1
  96. blaxel/core/client/models/trigger.py +0 -1
  97. blaxel/core/client/models/trigger_configuration.py +0 -1
  98. blaxel/core/client/models/volume.py +11 -4
  99. blaxel/core/client/models/volume_template.py +5 -2
  100. blaxel/core/client/models/workspace.py +5 -2
  101. blaxel/core/client/response_interceptor.py +3 -1
  102. blaxel/core/common/autoload.py +35 -3
  103. blaxel/core/common/env.py +10 -8
  104. blaxel/core/common/settings.py +4 -2
  105. blaxel/core/common/webhook.py +0 -1
  106. blaxel/core/jobs/__init__.py +13 -3
  107. blaxel/core/mcp/client.py +8 -2
  108. blaxel/core/mcp/server.py +8 -2
  109. blaxel/core/models/__init__.py +6 -5
  110. blaxel/core/sandbox/__init__.py +1 -1
  111. blaxel/core/sandbox/client/api/codegen/get_codegen_reranking_path.py +6 -2
  112. blaxel/core/sandbox/client/api/fastapply/put_codegen_fastapply_path.py +6 -2
  113. blaxel/core/sandbox/client/api/filesystem/delete_filesystem_multipart_upload_id_abort.py +6 -2
  114. blaxel/core/sandbox/client/api/filesystem/delete_filesystem_path.py +6 -2
  115. blaxel/core/sandbox/client/api/filesystem/delete_filesystem_tree_path.py +192 -0
  116. blaxel/core/sandbox/client/api/filesystem/get_filesystem_content_search_path.py +252 -0
  117. blaxel/core/sandbox/client/api/filesystem/get_filesystem_find_path.py +252 -0
  118. blaxel/core/sandbox/client/api/filesystem/get_filesystem_search_path.py +241 -0
  119. blaxel/core/sandbox/client/api/filesystem/get_filesystem_tree_path.py +197 -0
  120. blaxel/core/sandbox/client/api/filesystem/get_watch_filesystem_path.py +6 -2
  121. blaxel/core/sandbox/client/api/filesystem/post_filesystem_multipart_upload_id_complete.py +6 -2
  122. blaxel/core/sandbox/client/api/filesystem/put_filesystem_path.py +6 -2
  123. blaxel/core/sandbox/client/api/filesystem/put_filesystem_tree_path.py +223 -0
  124. blaxel/core/sandbox/client/api/process/delete_process_identifier.py +6 -2
  125. blaxel/core/sandbox/client/api/process/delete_process_identifier_kill.py +6 -2
  126. blaxel/core/sandbox/client/api/process/get_process.py +3 -1
  127. blaxel/core/sandbox/client/api/process/get_process_identifier.py +6 -2
  128. blaxel/core/sandbox/client/api/process/get_process_identifier_logs.py +6 -2
  129. blaxel/core/sandbox/client/api/process/get_process_identifier_logs_stream.py +6 -2
  130. blaxel/core/sandbox/client/api/process/post_process.py +6 -2
  131. blaxel/core/sandbox/client/client.py +3 -1
  132. blaxel/core/sandbox/client/models/__init__.py +16 -0
  133. blaxel/core/sandbox/client/models/content_search_match.py +98 -0
  134. blaxel/core/sandbox/client/models/content_search_response.py +97 -0
  135. blaxel/core/sandbox/client/models/filesystem_multipart_upload_parts.py +3 -1
  136. blaxel/core/sandbox/client/models/find_match.py +69 -0
  137. blaxel/core/sandbox/client/models/find_response.py +88 -0
  138. blaxel/core/sandbox/client/models/fuzzy_search_match.py +78 -0
  139. blaxel/core/sandbox/client/models/fuzzy_search_response.py +88 -0
  140. blaxel/core/sandbox/client/models/tree_request.py +76 -0
  141. blaxel/core/sandbox/client/models/tree_request_files.py +49 -0
  142. blaxel/core/sandbox/default/__init__.py +0 -1
  143. blaxel/core/sandbox/default/action.py +13 -9
  144. blaxel/core/sandbox/default/codegen.py +2 -4
  145. blaxel/core/sandbox/default/filesystem.py +210 -64
  146. blaxel/core/sandbox/default/interpreter.py +75 -61
  147. blaxel/core/sandbox/default/preview.py +6 -2
  148. blaxel/core/sandbox/default/process.py +88 -50
  149. blaxel/core/sandbox/default/sandbox.py +7 -2
  150. blaxel/core/sandbox/sync/__init__.py +0 -2
  151. blaxel/core/sandbox/sync/action.py +2 -3
  152. blaxel/core/sandbox/sync/codegen.py +1 -5
  153. blaxel/core/sandbox/sync/filesystem.py +17 -6
  154. blaxel/core/sandbox/sync/interpreter.py +10 -6
  155. blaxel/core/sandbox/sync/network.py +0 -2
  156. blaxel/core/sandbox/sync/preview.py +21 -9
  157. blaxel/core/sandbox/sync/process.py +32 -8
  158. blaxel/core/sandbox/sync/sandbox.py +13 -6
  159. blaxel/core/sandbox/sync/session.py +6 -4
  160. blaxel/core/sandbox/types.py +2 -1
  161. blaxel/core/tools/__init__.py +30 -6
  162. blaxel/core/tools/common.py +1 -1
  163. blaxel/core/tools/types.py +2 -1
  164. blaxel/crewai/model.py +20 -5
  165. blaxel/googleadk/__init__.py +1 -1
  166. blaxel/googleadk/tools.py +3 -5
  167. blaxel/langgraph/custom/gemini.py +126 -133
  168. blaxel/langgraph/model.py +54 -50
  169. blaxel/langgraph/tools.py +9 -3
  170. blaxel/llamaindex/custom/cohere.py +25 -16
  171. blaxel/llamaindex/model.py +44 -57
  172. blaxel/llamaindex/tools.py +2 -3
  173. blaxel/pydantic/custom/gemini.py +3 -3
  174. blaxel/pydantic/tools.py +2 -4
  175. blaxel/telemetry/exporters.py +10 -3
  176. blaxel/telemetry/instrumentation/blaxel_langgraph.py +4 -2
  177. blaxel/telemetry/instrumentation/blaxel_langgraph_gemini.py +22 -5
  178. blaxel/telemetry/instrumentation/utils.py +3 -3
  179. blaxel/telemetry/log/log.py +2 -3
  180. blaxel/telemetry/log/logger.py +21 -15
  181. blaxel/telemetry/span.py +10 -6
  182. {blaxel-0.2.29.dist-info → blaxel-0.2.31.dist-info}/METADATA +2 -2
  183. {blaxel-0.2.29.dist-info → blaxel-0.2.31.dist-info}/RECORD +185 -171
  184. {blaxel-0.2.29.dist-info → blaxel-0.2.31.dist-info}/WHEEL +0 -0
  185. {blaxel-0.2.29.dist-info → blaxel-0.2.31.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,241 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...models.fuzzy_search_response import FuzzySearchResponse
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ path: str,
15
+ *,
16
+ max_results: Union[Unset, int] = UNSET,
17
+ patterns: Union[Unset, str] = UNSET,
18
+ exclude_dirs: Union[Unset, str] = UNSET,
19
+ exclude_hidden: Union[Unset, bool] = UNSET,
20
+ ) -> dict[str, Any]:
21
+ params: dict[str, Any] = {}
22
+
23
+ params["maxResults"] = max_results
24
+
25
+ params["patterns"] = patterns
26
+
27
+ params["excludeDirs"] = exclude_dirs
28
+
29
+ params["excludeHidden"] = exclude_hidden
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": f"/filesystem-search/{path}",
36
+ "params": params,
37
+ }
38
+
39
+ return _kwargs
40
+
41
+
42
+ def _parse_response(
43
+ *, client: Client, response: httpx.Response
44
+ ) -> Union[ErrorResponse, FuzzySearchResponse] | None:
45
+ if response.status_code == 200:
46
+ response_200 = FuzzySearchResponse.from_dict(response.json())
47
+
48
+ return response_200
49
+ if response.status_code == 400:
50
+ response_400 = ErrorResponse.from_dict(response.json())
51
+
52
+ return response_400
53
+ if response.status_code == 422:
54
+ response_422 = ErrorResponse.from_dict(response.json())
55
+
56
+ return response_422
57
+ if response.status_code == 500:
58
+ response_500 = ErrorResponse.from_dict(response.json())
59
+
60
+ return response_500
61
+ if client.raise_on_unexpected_status:
62
+ raise errors.UnexpectedStatus(response.status_code, response.content)
63
+ else:
64
+ return None
65
+
66
+
67
+ def _build_response(
68
+ *, client: Client, response: httpx.Response
69
+ ) -> Response[Union[ErrorResponse, FuzzySearchResponse]]:
70
+ return Response(
71
+ status_code=HTTPStatus(response.status_code),
72
+ content=response.content,
73
+ headers=response.headers,
74
+ parsed=_parse_response(client=client, response=response),
75
+ )
76
+
77
+
78
+ def sync_detailed(
79
+ path: str,
80
+ *,
81
+ client: Union[Client],
82
+ max_results: Union[Unset, int] = UNSET,
83
+ patterns: Union[Unset, str] = UNSET,
84
+ exclude_dirs: Union[Unset, str] = UNSET,
85
+ exclude_hidden: Union[Unset, bool] = UNSET,
86
+ ) -> Response[Union[ErrorResponse, FuzzySearchResponse]]:
87
+ """Fuzzy search for files and directories
88
+
89
+ Performs fuzzy search on filesystem paths using fuzzy matching algorithm. Optimized alternative to
90
+ find and grep commands.
91
+
92
+ Args:
93
+ path (str):
94
+ max_results (Union[Unset, int]):
95
+ patterns (Union[Unset, str]):
96
+ exclude_dirs (Union[Unset, str]):
97
+ exclude_hidden (Union[Unset, bool]):
98
+
99
+ Raises:
100
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
101
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
102
+
103
+ Returns:
104
+ Response[Union[ErrorResponse, FuzzySearchResponse]]
105
+ """
106
+
107
+ kwargs = _get_kwargs(
108
+ path=path,
109
+ max_results=max_results,
110
+ patterns=patterns,
111
+ exclude_dirs=exclude_dirs,
112
+ exclude_hidden=exclude_hidden,
113
+ )
114
+
115
+ response = client.get_httpx_client().request(
116
+ **kwargs,
117
+ )
118
+
119
+ return _build_response(client=client, response=response)
120
+
121
+
122
+ def sync(
123
+ path: str,
124
+ *,
125
+ client: Union[Client],
126
+ max_results: Union[Unset, int] = UNSET,
127
+ patterns: Union[Unset, str] = UNSET,
128
+ exclude_dirs: Union[Unset, str] = UNSET,
129
+ exclude_hidden: Union[Unset, bool] = UNSET,
130
+ ) -> Union[ErrorResponse, FuzzySearchResponse] | None:
131
+ """Fuzzy search for files and directories
132
+
133
+ Performs fuzzy search on filesystem paths using fuzzy matching algorithm. Optimized alternative to
134
+ find and grep commands.
135
+
136
+ Args:
137
+ path (str):
138
+ max_results (Union[Unset, int]):
139
+ patterns (Union[Unset, str]):
140
+ exclude_dirs (Union[Unset, str]):
141
+ exclude_hidden (Union[Unset, bool]):
142
+
143
+ Raises:
144
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
145
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
146
+
147
+ Returns:
148
+ Union[ErrorResponse, FuzzySearchResponse]
149
+ """
150
+
151
+ return sync_detailed(
152
+ path=path,
153
+ client=client,
154
+ max_results=max_results,
155
+ patterns=patterns,
156
+ exclude_dirs=exclude_dirs,
157
+ exclude_hidden=exclude_hidden,
158
+ ).parsed
159
+
160
+
161
+ async def asyncio_detailed(
162
+ path: str,
163
+ *,
164
+ client: Union[Client],
165
+ max_results: Union[Unset, int] = UNSET,
166
+ patterns: Union[Unset, str] = UNSET,
167
+ exclude_dirs: Union[Unset, str] = UNSET,
168
+ exclude_hidden: Union[Unset, bool] = UNSET,
169
+ ) -> Response[Union[ErrorResponse, FuzzySearchResponse]]:
170
+ """Fuzzy search for files and directories
171
+
172
+ Performs fuzzy search on filesystem paths using fuzzy matching algorithm. Optimized alternative to
173
+ find and grep commands.
174
+
175
+ Args:
176
+ path (str):
177
+ max_results (Union[Unset, int]):
178
+ patterns (Union[Unset, str]):
179
+ exclude_dirs (Union[Unset, str]):
180
+ exclude_hidden (Union[Unset, bool]):
181
+
182
+ Raises:
183
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
184
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
185
+
186
+ Returns:
187
+ Response[Union[ErrorResponse, FuzzySearchResponse]]
188
+ """
189
+
190
+ kwargs = _get_kwargs(
191
+ path=path,
192
+ max_results=max_results,
193
+ patterns=patterns,
194
+ exclude_dirs=exclude_dirs,
195
+ exclude_hidden=exclude_hidden,
196
+ )
197
+
198
+ response = await client.get_async_httpx_client().request(**kwargs)
199
+
200
+ return _build_response(client=client, response=response)
201
+
202
+
203
+ async def asyncio(
204
+ path: str,
205
+ *,
206
+ client: Union[Client],
207
+ max_results: Union[Unset, int] = UNSET,
208
+ patterns: Union[Unset, str] = UNSET,
209
+ exclude_dirs: Union[Unset, str] = UNSET,
210
+ exclude_hidden: Union[Unset, bool] = UNSET,
211
+ ) -> Union[ErrorResponse, FuzzySearchResponse] | None:
212
+ """Fuzzy search for files and directories
213
+
214
+ Performs fuzzy search on filesystem paths using fuzzy matching algorithm. Optimized alternative to
215
+ find and grep commands.
216
+
217
+ Args:
218
+ path (str):
219
+ max_results (Union[Unset, int]):
220
+ patterns (Union[Unset, str]):
221
+ exclude_dirs (Union[Unset, str]):
222
+ exclude_hidden (Union[Unset, bool]):
223
+
224
+ Raises:
225
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
226
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
227
+
228
+ Returns:
229
+ Union[ErrorResponse, FuzzySearchResponse]
230
+ """
231
+
232
+ return (
233
+ await asyncio_detailed(
234
+ path=path,
235
+ client=client,
236
+ max_results=max_results,
237
+ patterns=patterns,
238
+ exclude_dirs=exclude_dirs,
239
+ exclude_hidden=exclude_hidden,
240
+ )
241
+ ).parsed
@@ -0,0 +1,197 @@
1
+ from http import HTTPStatus
2
+ from io import BytesIO
3
+ from typing import Any, Union
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import Client
9
+ from ...models.directory import Directory
10
+ from ...models.error_response import ErrorResponse
11
+ from ...models.file_with_content import FileWithContent
12
+ from ...types import File, Response
13
+
14
+
15
+ def _get_kwargs(
16
+ path: str,
17
+ ) -> dict[str, Any]:
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "get",
20
+ "url": f"/filesystem/tree/{path}",
21
+ }
22
+
23
+ return _kwargs
24
+
25
+
26
+ def _parse_response(
27
+ *, client: Client, response: httpx.Response
28
+ ) -> Union[ErrorResponse, Union["Directory", "FileWithContent", File]] | None:
29
+ if response.status_code == 200:
30
+
31
+ def _parse_response_200(data: object) -> Union["Directory", "FileWithContent", File]:
32
+ try:
33
+ if not isinstance(data, dict):
34
+ raise TypeError()
35
+ response_200_type_0 = Directory.from_dict(data)
36
+
37
+ return response_200_type_0
38
+ except: # noqa: E722
39
+ pass
40
+ try:
41
+ if not isinstance(data, dict):
42
+ raise TypeError()
43
+ response_200_type_1 = FileWithContent.from_dict(data)
44
+
45
+ return response_200_type_1
46
+ except: # noqa: E722
47
+ pass
48
+ if not isinstance(data, bytes):
49
+ raise TypeError()
50
+ response_200_type_2 = File(payload=BytesIO(data))
51
+
52
+ return response_200_type_2
53
+
54
+ response_200 = _parse_response_200(response.json())
55
+
56
+ return response_200
57
+ if response.status_code == 400:
58
+ response_400 = ErrorResponse.from_dict(response.json())
59
+
60
+ return response_400
61
+ if response.status_code == 422:
62
+ response_422 = ErrorResponse.from_dict(response.json())
63
+
64
+ return response_422
65
+ if response.status_code == 500:
66
+ response_500 = ErrorResponse.from_dict(response.json())
67
+
68
+ return response_500
69
+ if client.raise_on_unexpected_status:
70
+ raise errors.UnexpectedStatus(response.status_code, response.content)
71
+ else:
72
+ return None
73
+
74
+
75
+ def _build_response(
76
+ *, client: Client, response: httpx.Response
77
+ ) -> Response[Union[ErrorResponse, Union["Directory", "FileWithContent", File]]]:
78
+ return Response(
79
+ status_code=HTTPStatus(response.status_code),
80
+ content=response.content,
81
+ headers=response.headers,
82
+ parsed=_parse_response(client=client, response=response),
83
+ )
84
+
85
+
86
+ def sync_detailed(
87
+ path: str,
88
+ *,
89
+ client: Union[Client],
90
+ ) -> Response[Union[ErrorResponse, Union["Directory", "FileWithContent", File]]]:
91
+ """Get directory tree
92
+
93
+ Get a recursive directory tree structure starting from the specified path
94
+
95
+ Args:
96
+ path (str):
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
+ Response[Union[ErrorResponse, Union['Directory', 'FileWithContent', File]]]
104
+ """
105
+
106
+ kwargs = _get_kwargs(
107
+ path=path,
108
+ )
109
+
110
+ response = client.get_httpx_client().request(
111
+ **kwargs,
112
+ )
113
+
114
+ return _build_response(client=client, response=response)
115
+
116
+
117
+ def sync(
118
+ path: str,
119
+ *,
120
+ client: Union[Client],
121
+ ) -> Union[ErrorResponse, Union["Directory", "FileWithContent", File]] | None:
122
+ """Get directory tree
123
+
124
+ Get a recursive directory tree structure starting from the specified path
125
+
126
+ Args:
127
+ path (str):
128
+
129
+ Raises:
130
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
131
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
132
+
133
+ Returns:
134
+ Union[ErrorResponse, Union['Directory', 'FileWithContent', File]]
135
+ """
136
+
137
+ return sync_detailed(
138
+ path=path,
139
+ client=client,
140
+ ).parsed
141
+
142
+
143
+ async def asyncio_detailed(
144
+ path: str,
145
+ *,
146
+ client: Union[Client],
147
+ ) -> Response[Union[ErrorResponse, Union["Directory", "FileWithContent", File]]]:
148
+ """Get directory tree
149
+
150
+ Get a recursive directory tree structure starting from the specified path
151
+
152
+ Args:
153
+ path (str):
154
+
155
+ Raises:
156
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
157
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
158
+
159
+ Returns:
160
+ Response[Union[ErrorResponse, Union['Directory', 'FileWithContent', File]]]
161
+ """
162
+
163
+ kwargs = _get_kwargs(
164
+ path=path,
165
+ )
166
+
167
+ response = await client.get_async_httpx_client().request(**kwargs)
168
+
169
+ return _build_response(client=client, response=response)
170
+
171
+
172
+ async def asyncio(
173
+ path: str,
174
+ *,
175
+ client: Union[Client],
176
+ ) -> Union[ErrorResponse, Union["Directory", "FileWithContent", File]] | None:
177
+ """Get directory tree
178
+
179
+ Get a recursive directory tree structure starting from the specified path
180
+
181
+ Args:
182
+ path (str):
183
+
184
+ Raises:
185
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
186
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
187
+
188
+ Returns:
189
+ Union[ErrorResponse, Union['Directory', 'FileWithContent', File]]
190
+ """
191
+
192
+ return (
193
+ await asyncio_detailed(
194
+ path=path,
195
+ client=client,
196
+ )
197
+ ).parsed
@@ -29,7 +29,9 @@ def _get_kwargs(
29
29
  return _kwargs
30
30
 
31
31
 
32
- def _parse_response(*, client: Client, response: httpx.Response) -> Union[ErrorResponse, str] | None:
32
+ def _parse_response(
33
+ *, client: Client, response: httpx.Response
34
+ ) -> Union[ErrorResponse, str] | None:
33
35
  if response.status_code == 200:
34
36
  response_200 = response.text
35
37
  return response_200
@@ -47,7 +49,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Union[ErrorR
47
49
  return None
48
50
 
49
51
 
50
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, str]]:
52
+ def _build_response(
53
+ *, client: Client, response: httpx.Response
54
+ ) -> Response[Union[ErrorResponse, str]]:
51
55
  return Response(
52
56
  status_code=HTTPStatus(response.status_code),
53
57
  content=response.content,
@@ -35,7 +35,9 @@ def _get_kwargs(
35
35
  return _kwargs
36
36
 
37
37
 
38
- def _parse_response(*, client: Client, response: httpx.Response) -> Union[ErrorResponse, SuccessResponse] | None:
38
+ def _parse_response(
39
+ *, client: Client, response: httpx.Response
40
+ ) -> Union[ErrorResponse, SuccessResponse] | None:
39
41
  if response.status_code == 200:
40
42
  response_200 = SuccessResponse.from_dict(response.json())
41
43
 
@@ -58,7 +60,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Union[ErrorR
58
60
  return None
59
61
 
60
62
 
61
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, SuccessResponse]]:
63
+ def _build_response(
64
+ *, client: Client, response: httpx.Response
65
+ ) -> Response[Union[ErrorResponse, SuccessResponse]]:
62
66
  return Response(
63
67
  status_code=HTTPStatus(response.status_code),
64
68
  content=response.content,
@@ -35,7 +35,9 @@ def _get_kwargs(
35
35
  return _kwargs
36
36
 
37
37
 
38
- def _parse_response(*, client: Client, response: httpx.Response) -> Union[ErrorResponse, SuccessResponse] | None:
38
+ def _parse_response(
39
+ *, client: Client, response: httpx.Response
40
+ ) -> Union[ErrorResponse, SuccessResponse] | None:
39
41
  if response.status_code == 200:
40
42
  response_200 = SuccessResponse.from_dict(response.json())
41
43
 
@@ -58,7 +60,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Union[ErrorR
58
60
  return None
59
61
 
60
62
 
61
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[ErrorResponse, SuccessResponse]]:
63
+ def _build_response(
64
+ *, client: Client, response: httpx.Response
65
+ ) -> Response[Union[ErrorResponse, SuccessResponse]]:
62
66
  return Response(
63
67
  status_code=HTTPStatus(response.status_code),
64
68
  content=response.content,