Skip to content

Commit 26ab1a3

Browse files
committed
Regenerate client
1 parent acf5c3f commit 26ab1a3

File tree

5 files changed

+600
-17
lines changed

5 files changed

+600
-17
lines changed

src/diracx/client/aio/operations/_operations.py

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@
3737
build_jobs_delete_bulk_jobs_request,
3838
build_jobs_get_job_status_bulk_request,
3939
build_jobs_get_job_status_history_bulk_request,
40+
build_jobs_get_sandbox_file_request,
4041
build_jobs_get_single_job_request,
4142
build_jobs_get_single_job_status_history_request,
4243
build_jobs_get_single_job_status_request,
44+
build_jobs_initiate_sandbox_upload_request,
4345
build_jobs_kill_bulk_jobs_request,
4446
build_jobs_search_request,
4547
build_jobs_set_job_status_bulk_request,
@@ -819,6 +821,198 @@ def __init__(self, *args, **kwargs) -> None:
819821
input_args.pop(0) if input_args else kwargs.pop("deserializer")
820822
)
821823

824+
@overload
825+
async def initiate_sandbox_upload(
826+
self,
827+
body: _models.SandboxInfo,
828+
*,
829+
content_type: str = "application/json",
830+
**kwargs: Any
831+
) -> _models.SandboxUploadResponse:
832+
"""Initiate Sandbox Upload.
833+
834+
Get the PFN for the given sandbox, initiate an upload as required.
835+
836+
If the sandbox already exists in the database then the PFN is returned
837+
and there is no "url" field in the response.
838+
839+
If the sandbox does not exist in the database then the "url" and "fields"
840+
should be used to upload the sandbox to the storage backend.
841+
842+
:param body: Required.
843+
:type body: ~client.models.SandboxInfo
844+
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
845+
Default value is "application/json".
846+
:paramtype content_type: str
847+
:return: SandboxUploadResponse
848+
:rtype: ~client.models.SandboxUploadResponse
849+
:raises ~azure.core.exceptions.HttpResponseError:
850+
"""
851+
852+
@overload
853+
async def initiate_sandbox_upload(
854+
self, body: IO, *, content_type: str = "application/json", **kwargs: Any
855+
) -> _models.SandboxUploadResponse:
856+
"""Initiate Sandbox Upload.
857+
858+
Get the PFN for the given sandbox, initiate an upload as required.
859+
860+
If the sandbox already exists in the database then the PFN is returned
861+
and there is no "url" field in the response.
862+
863+
If the sandbox does not exist in the database then the "url" and "fields"
864+
should be used to upload the sandbox to the storage backend.
865+
866+
:param body: Required.
867+
:type body: IO
868+
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
869+
Default value is "application/json".
870+
:paramtype content_type: str
871+
:return: SandboxUploadResponse
872+
:rtype: ~client.models.SandboxUploadResponse
873+
:raises ~azure.core.exceptions.HttpResponseError:
874+
"""
875+
876+
@distributed_trace_async
877+
async def initiate_sandbox_upload(
878+
self, body: Union[_models.SandboxInfo, IO], **kwargs: Any
879+
) -> _models.SandboxUploadResponse:
880+
"""Initiate Sandbox Upload.
881+
882+
Get the PFN for the given sandbox, initiate an upload as required.
883+
884+
If the sandbox already exists in the database then the PFN is returned
885+
and there is no "url" field in the response.
886+
887+
If the sandbox does not exist in the database then the "url" and "fields"
888+
should be used to upload the sandbox to the storage backend.
889+
890+
:param body: Is either a SandboxInfo type or a IO type. Required.
891+
:type body: ~client.models.SandboxInfo or IO
892+
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
893+
Default value is None.
894+
:paramtype content_type: str
895+
:return: SandboxUploadResponse
896+
:rtype: ~client.models.SandboxUploadResponse
897+
:raises ~azure.core.exceptions.HttpResponseError:
898+
"""
899+
error_map = {
900+
401: ClientAuthenticationError,
901+
404: ResourceNotFoundError,
902+
409: ResourceExistsError,
903+
304: ResourceNotModifiedError,
904+
}
905+
error_map.update(kwargs.pop("error_map", {}) or {})
906+
907+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
908+
_params = kwargs.pop("params", {}) or {}
909+
910+
content_type: Optional[str] = kwargs.pop(
911+
"content_type", _headers.pop("Content-Type", None)
912+
)
913+
cls: ClsType[_models.SandboxUploadResponse] = kwargs.pop("cls", None)
914+
915+
content_type = content_type or "application/json"
916+
_json = None
917+
_content = None
918+
if isinstance(body, (IOBase, bytes)):
919+
_content = body
920+
else:
921+
_json = self._serialize.body(body, "SandboxInfo")
922+
923+
request = build_jobs_initiate_sandbox_upload_request(
924+
content_type=content_type,
925+
json=_json,
926+
content=_content,
927+
headers=_headers,
928+
params=_params,
929+
)
930+
request.url = self._client.format_url(request.url)
931+
932+
_stream = False
933+
pipeline_response: PipelineResponse = (
934+
await self._client._pipeline.run( # pylint: disable=protected-access
935+
request, stream=_stream, **kwargs
936+
)
937+
)
938+
939+
response = pipeline_response.http_response
940+
941+
if response.status_code not in [200]:
942+
map_error(
943+
status_code=response.status_code, response=response, error_map=error_map
944+
)
945+
raise HttpResponseError(response=response)
946+
947+
deserialized = self._deserialize("SandboxUploadResponse", pipeline_response)
948+
949+
if cls:
950+
return cls(pipeline_response, deserialized, {})
951+
952+
return deserialized
953+
954+
@distributed_trace_async
955+
async def get_sandbox_file(
956+
self, file_path: str, **kwargs: Any
957+
) -> _models.SandboxDownloadResponse:
958+
"""Get Sandbox File.
959+
960+
Get a presigned URL to download a sandbox file
961+
962+
This route cannot use a redirect response most clients will also send the
963+
authorization header when following a redirect. This is not desirable as
964+
it would leak the authorization token to the storage backend. Additionally,
965+
most storage backends return an error when they receive an authorization
966+
header for a presigned URL.
967+
968+
:param file_path: Required.
969+
:type file_path: str
970+
:return: SandboxDownloadResponse
971+
:rtype: ~client.models.SandboxDownloadResponse
972+
:raises ~azure.core.exceptions.HttpResponseError:
973+
"""
974+
error_map = {
975+
401: ClientAuthenticationError,
976+
404: ResourceNotFoundError,
977+
409: ResourceExistsError,
978+
304: ResourceNotModifiedError,
979+
}
980+
error_map.update(kwargs.pop("error_map", {}) or {})
981+
982+
_headers = kwargs.pop("headers", {}) or {}
983+
_params = kwargs.pop("params", {}) or {}
984+
985+
cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)
986+
987+
request = build_jobs_get_sandbox_file_request(
988+
file_path=file_path,
989+
headers=_headers,
990+
params=_params,
991+
)
992+
request.url = self._client.format_url(request.url)
993+
994+
_stream = False
995+
pipeline_response: PipelineResponse = (
996+
await self._client._pipeline.run( # pylint: disable=protected-access
997+
request, stream=_stream, **kwargs
998+
)
999+
)
1000+
1001+
response = pipeline_response.http_response
1002+
1003+
if response.status_code not in [200]:
1004+
map_error(
1005+
status_code=response.status_code, response=response, error_map=error_map
1006+
)
1007+
raise HttpResponseError(response=response)
1008+
1009+
deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)
1010+
1011+
if cls:
1012+
return cls(pipeline_response, deserialized, {})
1013+
1014+
return deserialized
1015+
8221016
@overload
8231017
async def submit_bulk_jobs(
8241018
self, body: List[str], *, content_type: str = "application/json", **kwargs: Any

src/diracx/client/models/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
from ._models import JobSummaryParams
1717
from ._models import JobSummaryParamsSearchItem
1818
from ._models import LimitedJobStatusReturn
19+
from ._models import SandboxDownloadResponse
20+
from ._models import SandboxInfo
21+
from ._models import SandboxUploadResponse
1922
from ._models import ScalarSearchSpec
2023
from ._models import SetJobStatusReturn
2124
from ._models import SortSpec
@@ -28,12 +31,14 @@
2831

2932
from ._enums import Enum0
3033
from ._enums import Enum1
34+
from ._enums import Enum10
35+
from ._enums import Enum11
3136
from ._enums import Enum2
3237
from ._enums import Enum3
3338
from ._enums import Enum4
34-
from ._enums import Enum8
35-
from ._enums import Enum9
3639
from ._enums import JobStatus
40+
from ._enums import SandboxChecksum
41+
from ._enums import SandboxFormat
3742
from ._enums import ScalarSearchOperator
3843
from ._enums import VectorSearchOperator
3944
from ._patch import __all__ as _patch_all
@@ -53,6 +58,9 @@
5358
"JobSummaryParams",
5459
"JobSummaryParamsSearchItem",
5560
"LimitedJobStatusReturn",
61+
"SandboxDownloadResponse",
62+
"SandboxInfo",
63+
"SandboxUploadResponse",
5664
"ScalarSearchSpec",
5765
"SetJobStatusReturn",
5866
"SortSpec",
@@ -64,12 +72,14 @@
6472
"VectorSearchSpec",
6573
"Enum0",
6674
"Enum1",
75+
"Enum10",
76+
"Enum11",
6777
"Enum2",
6878
"Enum3",
6979
"Enum4",
70-
"Enum8",
71-
"Enum9",
7280
"JobStatus",
81+
"SandboxChecksum",
82+
"SandboxFormat",
7383
"ScalarSearchOperator",
7484
"VectorSearchOperator",
7585
]

src/diracx/client/models/_enums.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ class Enum1(str, Enum, metaclass=CaseInsensitiveEnumMeta):
2222
)
2323

2424

25+
class Enum10(str, Enum, metaclass=CaseInsensitiveEnumMeta):
26+
"""Enum10."""
27+
28+
ASC = "asc"
29+
30+
31+
class Enum11(str, Enum, metaclass=CaseInsensitiveEnumMeta):
32+
"""Enum11."""
33+
34+
DSC = "dsc"
35+
36+
2537
class Enum2(str, Enum, metaclass=CaseInsensitiveEnumMeta):
2638
"""Enum2."""
2739

@@ -40,18 +52,6 @@ class Enum4(str, Enum, metaclass=CaseInsensitiveEnumMeta):
4052
S256 = "S256"
4153

4254

43-
class Enum8(str, Enum, metaclass=CaseInsensitiveEnumMeta):
44-
"""Enum8."""
45-
46-
ASC = "asc"
47-
48-
49-
class Enum9(str, Enum, metaclass=CaseInsensitiveEnumMeta):
50-
"""Enum9."""
51-
52-
DSC = "dsc"
53-
54-
5555
class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
5656
"""An enumeration."""
5757

@@ -72,6 +72,18 @@ class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
7272
RESCHEDULED = "Rescheduled"
7373

7474

75+
class SandboxChecksum(str, Enum, metaclass=CaseInsensitiveEnumMeta):
76+
"""An enumeration."""
77+
78+
SHA256 = "sha256"
79+
80+
81+
class SandboxFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta):
82+
"""An enumeration."""
83+
84+
TAR_BZ2 = "tar.bz2"
85+
86+
7587
class ScalarSearchOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
7688
"""An enumeration."""
7789

0 commit comments

Comments
 (0)