@@ -522,22 +522,31 @@ def file(
522522 raise ApiError (status_code = _response .status_code , body = _response .text )
523523 raise ApiError (status_code = _response .status_code , body = _response_json )
524524
525- def download (self , instance_id : str , * , path : str , request_options : typing .Optional [RequestOptions ] = None ) -> None :
525+ def download (
526+ self , instance_id : str , * , path : str , local_path : str , request_options : typing .Optional [RequestOptions ] = None
527+ ) -> FileResponse :
526528 """
527- Download a file from the instance.
529+ Download a file from the instance and save it to a local path.
530+
531+ Args:
532+ path: Path of the file on the instance
533+ local_path: Path where to save the file locally
528534
529535 Parameters
530536 ----------
531537 instance_id : str
532538
533539 path : str
534540
541+ local_path : str
542+
535543 request_options : typing.Optional[RequestOptions]
536544 Request-specific configuration.
537545
538546 Returns
539547 -------
540- None
548+ FileResponse
549+ Successful Response
541550
542551 Examples
543552 --------
@@ -549,19 +558,27 @@ def download(self, instance_id: str, *, path: str, request_options: typing.Optio
549558 client.instance.download(
550559 instance_id="instance_id",
551560 path="path",
561+ local_path="local_path",
552562 )
553563 """
554564 _response = self ._client_wrapper .httpx_client .request (
555565 f"v1/instance/{ jsonable_encoder (instance_id )} /download" ,
556566 method = "GET" ,
557567 params = {
558568 "path" : path ,
569+ "local_path" : local_path ,
559570 },
560571 request_options = request_options ,
561572 )
562573 try :
563574 if 200 <= _response .status_code < 300 :
564- return
575+ return typing .cast (
576+ FileResponse ,
577+ parse_obj_as (
578+ type_ = FileResponse , # type: ignore
579+ object_ = _response .json (),
580+ ),
581+ )
565582 if _response .status_code == 422 :
566583 raise UnprocessableEntityError (
567584 typing .cast (
@@ -1369,23 +1386,30 @@ async def main() -> None:
13691386 raise ApiError (status_code = _response .status_code , body = _response_json )
13701387
13711388 async def download (
1372- self , instance_id : str , * , path : str , request_options : typing .Optional [RequestOptions ] = None
1373- ) -> None :
1389+ self , instance_id : str , * , path : str , local_path : str , request_options : typing .Optional [RequestOptions ] = None
1390+ ) -> FileResponse :
13741391 """
1375- Download a file from the instance.
1392+ Download a file from the instance and save it to a local path.
1393+
1394+ Args:
1395+ path: Path of the file on the instance
1396+ local_path: Path where to save the file locally
13761397
13771398 Parameters
13781399 ----------
13791400 instance_id : str
13801401
13811402 path : str
13821403
1404+ local_path : str
1405+
13831406 request_options : typing.Optional[RequestOptions]
13841407 Request-specific configuration.
13851408
13861409 Returns
13871410 -------
1388- None
1411+ FileResponse
1412+ Successful Response
13891413
13901414 Examples
13911415 --------
@@ -1402,6 +1426,7 @@ async def main() -> None:
14021426 await client.instance.download(
14031427 instance_id="instance_id",
14041428 path="path",
1429+ local_path="local_path",
14051430 )
14061431
14071432
@@ -1412,12 +1437,19 @@ async def main() -> None:
14121437 method = "GET" ,
14131438 params = {
14141439 "path" : path ,
1440+ "local_path" : local_path ,
14151441 },
14161442 request_options = request_options ,
14171443 )
14181444 try :
14191445 if 200 <= _response .status_code < 300 :
1420- return
1446+ return typing .cast (
1447+ FileResponse ,
1448+ parse_obj_as (
1449+ type_ = FileResponse , # type: ignore
1450+ object_ = _response .json (),
1451+ ),
1452+ )
14211453 if _response .status_code == 422 :
14221454 raise UnprocessableEntityError (
14231455 typing .cast (
0 commit comments