Debian Codegraph @

src/anthropic/resources/files.py

raw
1 from __future__ import annotations
2
3 from typing import Mapping, Optional, cast
4
5 import httpx2
6
7 from .._files import deepcopy_with_paths
8 from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, SequenceNotStr, omit, not_given
9 from .._utils import extract_files, path_template, strip_not_given
10 from .._compat import cached_property
11 from .._resource import SyncAPIResource, AsyncAPIResource
12 from .._response import (
13 BinaryAPIResponse,
14 AsyncBinaryAPIResponse,
15 StreamedBinaryAPIResponse,
16 AsyncStreamedBinaryAPIResponse,
17 to_raw_response_wrapper,
18 to_streamed_response_wrapper,
19 async_to_raw_response_wrapper,
20 to_custom_raw_response_wrapper,
21 async_to_streamed_response_wrapper,
22 to_custom_streamed_response_wrapper,
23 async_to_custom_raw_response_wrapper,
24 async_to_custom_streamed_response_wrapper,
25 )
26 from ..pagination import SyncPageCursor, AsyncPageCursor
27 from .._base_client import (
28 AsyncPaginator,
29 merge_headers,
30 make_request_options,
31 )
32 from ..types.deleted_file import DeletedFile
33 from ..types.file_metadata import FileMetadata
34 from ..lib._stainless_helpers import stainless_helper_header_from_file as _stainless_helper_header_from_file
35
36 __all__ = ["Files", "AsyncFiles"]
37
38
39 class Files(SyncAPIResource):
40 @cached_property
41 def with_raw_response(self) -> FilesWithRawResponse:
42 """
43 This property can be used as a prefix for any HTTP method call to return
44 the raw response object instead of the parsed content.
45
46 For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
47 """
48 return FilesWithRawResponse(self)
49
50 @cached_property
51 def with_streaming_response(self) -> FilesWithStreamingResponse:
52 """
53 An alternative to `.with_raw_response` that doesn't eagerly read the response body.
54
55 For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
56 """
57 return FilesWithStreamingResponse(self)
58
59 def list(
60 self,
61 *,
62 ids: Optional[SequenceNotStr[str]] | Omit = omit,
63 limit: int | Omit = omit,
64 page: Optional[str] | Omit = omit,
65 workspace_id: str | Omit = omit,
66 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
67 # The extra values given here take precedence over values defined on the client or passed to this method.
68 extra_headers: Headers | None = None,
69 extra_query: Query | None = None,
70 extra_body: Body | None = None,
71 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
72 ) -> SyncPageCursor[FileMetadata]:
73 """
74 List Files
75
76 Args:
77 ids: Restrict the result set to Files whose `id` is in this list. At most 100 entries
78 (after de-duplication). Mutually exclusive with `page` and `limit`. When
79 supplied, the response is always a single page (`next_page` is null). IDs that
80 do not resolve to a visible File — including deleted Files — are silently
81 omitted.
82
83 limit: Number of items to return per page.
84
85 Defaults to `20`. Ranges from `1` to `1000`.
86
87 page: Opaque page cursor returned in a prior list response's `next_page`. Prefixed
88 `page_`.
89
90 workspace_id: Optional header to select the Workspace for this request. The value is a
91 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
92
93 Only needed for credentials that can act on more than one Workspace. A
94 credential that belongs to a specific Workspace may omit it; if sent, it must
95 match that Workspace.
96
97 extra_headers: Send extra headers
98
99 extra_query: Add additional query parameters to the request
100
101 extra_body: Add additional JSON properties to the request
102
103 timeout: Override the client-level default timeout for this request, in seconds
104 """
105 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
106 return self._get_api_list(
107 "/v1/files",
108 page=SyncPageCursor[FileMetadata],
109 options=make_request_options(
110 extra_headers=extra_headers,
111 extra_query=extra_query,
112 extra_body=extra_body,
113 timeout=timeout,
114 query={
115 "ids": ids,
116 "limit": limit,
117 "page": page,
118 },
119 ),
120 model=FileMetadata,
121 )
122
123 def delete(
124 self,
125 file_id: str,
126 *,
127 workspace_id: str | Omit = omit,
128 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
129 # The extra values given here take precedence over values defined on the client or passed to this method.
130 extra_headers: Headers | None = None,
131 extra_query: Query | None = None,
132 extra_body: Body | None = None,
133 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
134 ) -> DeletedFile:
135 """
136 Delete File
137
138 Args:
139 file_id: ID of the File.
140
141 workspace_id: Optional header to select the Workspace for this request. The value is a
142 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
143
144 Only needed for credentials that can act on more than one Workspace. A
145 credential that belongs to a specific Workspace may omit it; if sent, it must
146 match that Workspace.
147
148 extra_headers: Send extra headers
149
150 extra_query: Add additional query parameters to the request
151
152 extra_body: Add additional JSON properties to the request
153
154 timeout: Override the client-level default timeout for this request, in seconds
155 """
156 if not file_id:
157 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
158 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
159 return self._delete(
160 path_template("/v1/files/{file_id}", file_id=file_id),
161 options=make_request_options(
162 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
163 ),
164 cast_to=DeletedFile,
165 )
166
167 def download(
168 self,
169 file_id: str,
170 *,
171 workspace_id: str | Omit = omit,
172 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
173 # The extra values given here take precedence over values defined on the client or passed to this method.
174 extra_headers: Headers | None = None,
175 extra_query: Query | None = None,
176 extra_body: Body | None = None,
177 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
178 ) -> BinaryAPIResponse:
179 """
180 Download File
181
182 Args:
183 file_id: ID of the File.
184
185 workspace_id: Optional header to select the Workspace for this request. The value is a
186 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
187
188 Only needed for credentials that can act on more than one Workspace. A
189 credential that belongs to a specific Workspace may omit it; if sent, it must
190 match that Workspace.
191
192 extra_headers: Send extra headers
193
194 extra_query: Add additional query parameters to the request
195
196 extra_body: Add additional JSON properties to the request
197
198 timeout: Override the client-level default timeout for this request, in seconds
199 """
200 if not file_id:
201 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
202 extra_headers = {"Accept": "application/binary", **(extra_headers or {})}
203 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
204 return self._get(
205 path_template("/v1/files/{file_id}/content", file_id=file_id),
206 options=make_request_options(
207 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
208 ),
209 cast_to=BinaryAPIResponse,
210 )
211
212 def retrieve_metadata(
213 self,
214 file_id: str,
215 *,
216 workspace_id: str | Omit = omit,
217 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
218 # The extra values given here take precedence over values defined on the client or passed to this method.
219 extra_headers: Headers | None = None,
220 extra_query: Query | None = None,
221 extra_body: Body | None = None,
222 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
223 ) -> FileMetadata:
224 """
225 Get File Metadata
226
227 Args:
228 file_id: ID of the File.
229
230 workspace_id: Optional header to select the Workspace for this request. The value is a
231 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
232
233 Only needed for credentials that can act on more than one Workspace. A
234 credential that belongs to a specific Workspace may omit it; if sent, it must
235 match that Workspace.
236
237 extra_headers: Send extra headers
238
239 extra_query: Add additional query parameters to the request
240
241 extra_body: Add additional JSON properties to the request
242
243 timeout: Override the client-level default timeout for this request, in seconds
244 """
245 if not file_id:
246 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
247 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
248 return self._get(
249 path_template("/v1/files/{file_id}", file_id=file_id),
250 options=make_request_options(
251 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
252 ),
253 cast_to=FileMetadata,
254 )
255
256 def upload(
257 self,
258 *,
259 file: FileTypes,
260 expires_in_seconds: int | Omit = omit,
261 workspace_id: str | Omit = omit,
262 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
263 # The extra values given here take precedence over values defined on the client or passed to this method.
264 extra_headers: Headers | None = None,
265 extra_query: Query | None = None,
266 extra_body: Body | None = None,
267 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
268 ) -> FileMetadata:
269 """Upload File
270
271 Args:
272 file: The file to upload.
273
274 Only the final path component of the part's `filename` is
275 kept; an absent or empty `filename` is replaced with `unnamed` plus the
276 extension for the file's stored `mime_type`, when known.
277
278 expires_in_seconds: Seconds from upload until the file expires and its bytes become permanently
279 unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).
280
281 workspace_id: Optional header to select the Workspace for this request. The value is a
282 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
283
284 Only needed for credentials that can act on more than one Workspace. A
285 credential that belongs to a specific Workspace may omit it; if sent, it must
286 match that Workspace.
287
288 extra_headers: Send extra headers
289
290 extra_query: Add additional query parameters to the request
291
292 extra_body: Add additional JSON properties to the request
293
294 timeout: Override the client-level default timeout for this request, in seconds
295 """
296 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
297 extra_headers = merge_headers(_stainless_helper_header_from_file(file), extra_headers or {})
298 body = deepcopy_with_paths(
299 {
300 "file": file,
301 "expires_in_seconds": expires_in_seconds,
302 },
303 [["file"]],
304 )
305 files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
306 # It should be noted that the actual Content-Type header that will be
307 # sent to the server will contain a `boundary` parameter, e.g.
308 # multipart/form-data; boundary=---abc--
309 extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
310 return self._post(
311 "/v1/files",
312 body=body,
313 files=files,
314 options=make_request_options(
315 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
316 ),
317 cast_to=FileMetadata,
318 )
319
320
321 class AsyncFiles(AsyncAPIResource):
322 @cached_property
323 def with_raw_response(self) -> AsyncFilesWithRawResponse:
324 """
325 This property can be used as a prefix for any HTTP method call to return
326 the raw response object instead of the parsed content.
327
328 For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
329 """
330 return AsyncFilesWithRawResponse(self)
331
332 @cached_property
333 def with_streaming_response(self) -> AsyncFilesWithStreamingResponse:
334 """
335 An alternative to `.with_raw_response` that doesn't eagerly read the response body.
336
337 For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
338 """
339 return AsyncFilesWithStreamingResponse(self)
340
341 def list(
342 self,
343 *,
344 ids: Optional[SequenceNotStr[str]] | Omit = omit,
345 limit: int | Omit = omit,
346 page: Optional[str] | Omit = omit,
347 workspace_id: str | Omit = omit,
348 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349 # The extra values given here take precedence over values defined on the client or passed to this method.
350 extra_headers: Headers | None = None,
351 extra_query: Query | None = None,
352 extra_body: Body | None = None,
353 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
354 ) -> AsyncPaginator[FileMetadata, AsyncPageCursor[FileMetadata]]:
355 """
356 List Files
357
358 Args:
359 ids: Restrict the result set to Files whose `id` is in this list. At most 100 entries
360 (after de-duplication). Mutually exclusive with `page` and `limit`. When
361 supplied, the response is always a single page (`next_page` is null). IDs that
362 do not resolve to a visible File — including deleted Files — are silently
363 omitted.
364
365 limit: Number of items to return per page.
366
367 Defaults to `20`. Ranges from `1` to `1000`.
368
369 page: Opaque page cursor returned in a prior list response's `next_page`. Prefixed
370 `page_`.
371
372 workspace_id: Optional header to select the Workspace for this request. The value is a
373 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
374
375 Only needed for credentials that can act on more than one Workspace. A
376 credential that belongs to a specific Workspace may omit it; if sent, it must
377 match that Workspace.
378
379 extra_headers: Send extra headers
380
381 extra_query: Add additional query parameters to the request
382
383 extra_body: Add additional JSON properties to the request
384
385 timeout: Override the client-level default timeout for this request, in seconds
386 """
387 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
388 return self._get_api_list(
389 "/v1/files",
390 page=AsyncPageCursor[FileMetadata],
391 options=make_request_options(
392 extra_headers=extra_headers,
393 extra_query=extra_query,
394 extra_body=extra_body,
395 timeout=timeout,
396 query={
397 "ids": ids,
398 "limit": limit,
399 "page": page,
400 },
401 ),
402 model=FileMetadata,
403 )
404
405 async def delete(
406 self,
407 file_id: str,
408 *,
409 workspace_id: str | Omit = omit,
410 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
411 # The extra values given here take precedence over values defined on the client or passed to this method.
412 extra_headers: Headers | None = None,
413 extra_query: Query | None = None,
414 extra_body: Body | None = None,
415 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
416 ) -> DeletedFile:
417 """
418 Delete File
419
420 Args:
421 file_id: ID of the File.
422
423 workspace_id: Optional header to select the Workspace for this request. The value is a
424 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
425
426 Only needed for credentials that can act on more than one Workspace. A
427 credential that belongs to a specific Workspace may omit it; if sent, it must
428 match that Workspace.
429
430 extra_headers: Send extra headers
431
432 extra_query: Add additional query parameters to the request
433
434 extra_body: Add additional JSON properties to the request
435
436 timeout: Override the client-level default timeout for this request, in seconds
437 """
438 if not file_id:
439 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
440 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
441 return await self._delete(
442 path_template("/v1/files/{file_id}", file_id=file_id),
443 options=make_request_options(
444 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
445 ),
446 cast_to=DeletedFile,
447 )
448
449 async def download(
450 self,
451 file_id: str,
452 *,
453 workspace_id: str | Omit = omit,
454 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
455 # The extra values given here take precedence over values defined on the client or passed to this method.
456 extra_headers: Headers | None = None,
457 extra_query: Query | None = None,
458 extra_body: Body | None = None,
459 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
460 ) -> AsyncBinaryAPIResponse:
461 """
462 Download File
463
464 Args:
465 file_id: ID of the File.
466
467 workspace_id: Optional header to select the Workspace for this request. The value is a
468 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
469
470 Only needed for credentials that can act on more than one Workspace. A
471 credential that belongs to a specific Workspace may omit it; if sent, it must
472 match that Workspace.
473
474 extra_headers: Send extra headers
475
476 extra_query: Add additional query parameters to the request
477
478 extra_body: Add additional JSON properties to the request
479
480 timeout: Override the client-level default timeout for this request, in seconds
481 """
482 if not file_id:
483 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
484 extra_headers = {"Accept": "application/binary", **(extra_headers or {})}
485 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
486 return await self._get(
487 path_template("/v1/files/{file_id}/content", file_id=file_id),
488 options=make_request_options(
489 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
490 ),
491 cast_to=AsyncBinaryAPIResponse,
492 )
493
494 async def retrieve_metadata(
495 self,
496 file_id: str,
497 *,
498 workspace_id: str | Omit = omit,
499 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
500 # The extra values given here take precedence over values defined on the client or passed to this method.
501 extra_headers: Headers | None = None,
502 extra_query: Query | None = None,
503 extra_body: Body | None = None,
504 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
505 ) -> FileMetadata:
506 """
507 Get File Metadata
508
509 Args:
510 file_id: ID of the File.
511
512 workspace_id: Optional header to select the Workspace for this request. The value is a
513 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
514
515 Only needed for credentials that can act on more than one Workspace. A
516 credential that belongs to a specific Workspace may omit it; if sent, it must
517 match that Workspace.
518
519 extra_headers: Send extra headers
520
521 extra_query: Add additional query parameters to the request
522
523 extra_body: Add additional JSON properties to the request
524
525 timeout: Override the client-level default timeout for this request, in seconds
526 """
527 if not file_id:
528 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
529 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
530 return await self._get(
531 path_template("/v1/files/{file_id}", file_id=file_id),
532 options=make_request_options(
533 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
534 ),
535 cast_to=FileMetadata,
536 )
537
538 async def upload(
539 self,
540 *,
541 file: FileTypes,
542 expires_in_seconds: int | Omit = omit,
543 workspace_id: str | Omit = omit,
544 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
545 # The extra values given here take precedence over values defined on the client or passed to this method.
546 extra_headers: Headers | None = None,
547 extra_query: Query | None = None,
548 extra_body: Body | None = None,
549 timeout: float | httpx2.Timeout | None | NotGiven = not_given,
550 ) -> FileMetadata:
551 """Upload File
552
553 Args:
554 file: The file to upload.
555
556 Only the final path component of the part's `filename` is
557 kept; an absent or empty `filename` is replaced with `unnamed` plus the
558 extension for the file's stored `mime_type`, when known.
559
560 expires_in_seconds: Seconds from upload until the file expires and its bytes become permanently
561 unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).
562
563 workspace_id: Optional header to select the Workspace for this request. The value is a
564 Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
565
566 Only needed for credentials that can act on more than one Workspace. A
567 credential that belongs to a specific Workspace may omit it; if sent, it must
568 match that Workspace.
569
570 extra_headers: Send extra headers
571
572 extra_query: Add additional query parameters to the request
573
574 extra_body: Add additional JSON properties to the request
575
576 timeout: Override the client-level default timeout for this request, in seconds
577 """
578 extra_headers = {**strip_not_given({"anthropic-workspace-id": workspace_id}), **(extra_headers or {})}
579 extra_headers = merge_headers(_stainless_helper_header_from_file(file), extra_headers or {})
580 body = deepcopy_with_paths(
581 {
582 "file": file,
583 "expires_in_seconds": expires_in_seconds,
584 },
585 [["file"]],
586 )
587 files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
588 # It should be noted that the actual Content-Type header that will be
589 # sent to the server will contain a `boundary` parameter, e.g.
590 # multipart/form-data; boundary=---abc--
591 extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
592 return await self._post(
593 "/v1/files",
594 body=body,
595 files=files,
596 options=make_request_options(
597 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
598 ),
599 cast_to=FileMetadata,
600 )
601
602
603 class FilesWithRawResponse:
604 def __init__(self, files: Files) -> None:
605 self._files = files
606
607 self.list = to_raw_response_wrapper(
608 files.list,
609 )
610 self.delete = to_raw_response_wrapper(
611 files.delete,
612 )
613 self.download = to_custom_raw_response_wrapper(
614 files.download,
615 BinaryAPIResponse,
616 )
617 self.retrieve_metadata = to_raw_response_wrapper(
618 files.retrieve_metadata,
619 )
620 self.upload = to_raw_response_wrapper(
621 files.upload,
622 )
623
624
625 class AsyncFilesWithRawResponse:
626 def __init__(self, files: AsyncFiles) -> None:
627 self._files = files
628
629 self.list = async_to_raw_response_wrapper(
630 files.list,
631 )
632 self.delete = async_to_raw_response_wrapper(
633 files.delete,
634 )
635 self.download = async_to_custom_raw_response_wrapper(
636 files.download,
637 AsyncBinaryAPIResponse,
638 )
639 self.retrieve_metadata = async_to_raw_response_wrapper(
640 files.retrieve_metadata,
641 )
642 self.upload = async_to_raw_response_wrapper(
643 files.upload,
644 )
645
646
647 class FilesWithStreamingResponse:
648 def __init__(self, files: Files) -> None:
649 self._files = files
650
651 self.list = to_streamed_response_wrapper(
652 files.list,
653 )
654 self.delete = to_streamed_response_wrapper(
655 files.delete,
656 )
657 self.download = to_custom_streamed_response_wrapper(
658 files.download,
659 StreamedBinaryAPIResponse,
660 )
661 self.retrieve_metadata = to_streamed_response_wrapper(
662 files.retrieve_metadata,
663 )
664 self.upload = to_streamed_response_wrapper(
665 files.upload,
666 )
667
668
669 class AsyncFilesWithStreamingResponse:
670 def __init__(self, files: AsyncFiles) -> None:
671 self._files = files
672
673 self.list = async_to_streamed_response_wrapper(
674 files.list,
675 )
676 self.delete = async_to_streamed_response_wrapper(
677 files.delete,
678 )
679 self.download = async_to_custom_streamed_response_wrapper(
680 files.download,
681 AsyncStreamedBinaryAPIResponse,
682 )
683 self.retrieve_metadata = async_to_streamed_response_wrapper(
684 files.retrieve_metadata,
685 )
686 self.upload = async_to_streamed_response_wrapper(
687 files.upload,
688 )