Skip to content

Commit

Permalink
Regenerate client
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Jun 8, 2024
1 parent d8c8d1a commit d6f81c3
Show file tree
Hide file tree
Showing 16 changed files with 312 additions and 297 deletions.
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/_configuration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ def _deserialize(self, target_obj, data):
elif isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)

if data is None:
if data is None or data is CoreNull:
return data
try:
attributes = response._attribute_map # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/_vendor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/aio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/aio/_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/aio/_configuration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/aio/_vendor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/aio/operations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
212 changes: 106 additions & 106 deletions diracx-client/src/diracx/client/aio/operations/_operations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
Expand Down Expand Up @@ -245,22 +245,25 @@ def __init__(self, *args, **kwargs) -> None:
)

@distributed_trace_async
async def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
"""Do Device Flow.
async def initiate_device_flow(
self, *, client_id: str, scope: str, **kwargs: Any
) -> _models.InitiateDeviceFlowResponse:
"""Initiate Device Flow.
This is called as the verification URI for the device flow.
It will redirect to the actual OpenID server (IAM, CheckIn) to
perform a authorization code flow.
Initiate the device flow against DIRAC authorization Server.
Scope must have exactly up to one ``group`` (otherwise default) and
one or more ``property`` scope.
If no property, then get default one
We set the user_code obtained from the device flow in a cookie
to be able to map the authorization flow with the corresponding
device flow.
(note: it can't be put as parameter or in the URL).
Offers the user to go with the browser to
``auth/<vo>/device?user_code=XYZ``.
:keyword user_code: Required.
:paramtype user_code: str
:return: any
:rtype: any
:keyword client_id: Required.
:paramtype client_id: str
:keyword scope: Required.
:paramtype scope: str
:return: InitiateDeviceFlowResponse
:rtype: ~client.models.InitiateDeviceFlowResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
Expand All @@ -274,10 +277,11 @@ async def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

cls: ClsType[Any] = kwargs.pop("cls", None)
cls: ClsType[_models.InitiateDeviceFlowResponse] = kwargs.pop("cls", None)

_request = build_auth_do_device_flow_request(
user_code=user_code,
_request = build_auth_initiate_device_flow_request(
client_id=client_id,
scope=scope,
headers=_headers,
params=_params,
)
Expand All @@ -300,33 +304,32 @@ async def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
)
raise HttpResponseError(response=response)

deserialized = self._deserialize("object", pipeline_response)
deserialized = self._deserialize(
"InitiateDeviceFlowResponse", pipeline_response
)

if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore

return deserialized # type: ignore

@distributed_trace_async
async def initiate_device_flow(
self, *, client_id: str, scope: str, **kwargs: Any
) -> _models.InitiateDeviceFlowResponse:
"""Initiate Device Flow.
async def do_device_flow(self, *, user_code: str, **kwargs: Any) -> Any:
"""Do Device Flow.
Initiate the device flow against DIRAC authorization Server.
Scope must have exactly up to one ``group`` (otherwise default) and
one or more ``property`` scope.
If no property, then get default one
This is called as the verification URI for the device flow.
It will redirect to the actual OpenID server (IAM, CheckIn) to
perform a authorization code flow.
Offers the user to go with the browser to
``auth/<vo>/device?user_code=XYZ``.
We set the user_code obtained from the device flow in a cookie
to be able to map the authorization flow with the corresponding
device flow.
(note: it can't be put as parameter or in the URL).
:keyword client_id: Required.
:paramtype client_id: str
:keyword scope: Required.
:paramtype scope: str
:return: InitiateDeviceFlowResponse
:rtype: ~client.models.InitiateDeviceFlowResponse
:keyword user_code: Required.
:paramtype user_code: str
:return: any
:rtype: any
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
Expand All @@ -340,11 +343,10 @@ async def initiate_device_flow(
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

cls: ClsType[_models.InitiateDeviceFlowResponse] = kwargs.pop("cls", None)
cls: ClsType[Any] = kwargs.pop("cls", None)

_request = build_auth_initiate_device_flow_request(
client_id=client_id,
scope=scope,
_request = build_auth_do_device_flow_request(
user_code=user_code,
headers=_headers,
params=_params,
)
Expand All @@ -367,9 +369,7 @@ async def initiate_device_flow(
)
raise HttpResponseError(response=response)

deserialized = self._deserialize(
"InitiateDeviceFlowResponse", pipeline_response
)
deserialized = self._deserialize("object", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
Expand Down Expand Up @@ -939,70 +939,6 @@ def __init__(self, *args, **kwargs) -> None:
input_args.pop(0) if input_args else kwargs.pop("deserializer")
)

@distributed_trace_async
async def get_sandbox_file(
self, *, pfn: str, **kwargs: Any
) -> _models.SandboxDownloadResponse:
"""Get Sandbox File.
Get a presigned URL to download a sandbox file
This route cannot use a redirect response most clients will also send the
authorization header when following a redirect. This is not desirable as
it would leak the authorization token to the storage backend. Additionally,
most storage backends return an error when they receive an authorization
header for a presigned URL.
:keyword pfn: Required.
:paramtype pfn: str
:return: SandboxDownloadResponse
:rtype: ~client.models.SandboxDownloadResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)

_request = build_jobs_get_sandbox_file_request(
pfn=pfn,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)

_stream = False
pipeline_response: PipelineResponse = (
await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
)

response = pipeline_response.http_response

if response.status_code not in [200]:
if _stream:
await response.read() # Load the body in memory and close the socket
map_error(
status_code=response.status_code, response=response, error_map=error_map
)
raise HttpResponseError(response=response)

deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore

return deserialized # type: ignore

@overload
async def initiate_sandbox_upload(
self,
Expand Down Expand Up @@ -1132,6 +1068,70 @@ async def initiate_sandbox_upload(

return deserialized # type: ignore

@distributed_trace_async
async def get_sandbox_file(
self, *, pfn: str, **kwargs: Any
) -> _models.SandboxDownloadResponse:
"""Get Sandbox File.
Get a presigned URL to download a sandbox file
This route cannot use a redirect response most clients will also send the
authorization header when following a redirect. This is not desirable as
it would leak the authorization token to the storage backend. Additionally,
most storage backends return an error when they receive an authorization
header for a presigned URL.
:keyword pfn: Required.
:paramtype pfn: str
:return: SandboxDownloadResponse
:rtype: ~client.models.SandboxDownloadResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

cls: ClsType[_models.SandboxDownloadResponse] = kwargs.pop("cls", None)

_request = build_jobs_get_sandbox_file_request(
pfn=pfn,
headers=_headers,
params=_params,
)
_request.url = self._client.format_url(_request.url)

_stream = False
pipeline_response: PipelineResponse = (
await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
)

response = pipeline_response.http_response

if response.status_code not in [200]:
if _stream:
await response.read() # Load the body in memory and close the socket
map_error(
status_code=response.status_code, response=response, error_map=error_map
)
raise HttpResponseError(response=response)

deserialized = self._deserialize("SandboxDownloadResponse", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore

return deserialized # type: ignore

@distributed_trace_async
async def unassign_bulk_jobs_sandboxes(
self, *, jobs_ids: List[int], **kwargs: Any
Expand Down Expand Up @@ -1369,7 +1369,7 @@ async def get_job_sandbox(
async def assign_sandbox_to_job(self, job_id: int, body: str, **kwargs: Any) -> Any:
"""Assign Sandbox To Job.
Mapp the pfn as output sandbox to job.
Map the pfn as output sandbox to job.
:param job_id: Required.
:type job_id: int
Expand Down
2 changes: 1 addition & 1 deletion diracx-client/src/diracx/client/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].17)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/[email protected].19)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Loading

0 comments on commit d6f81c3

Please sign in to comment.