Skip to content

Commit

Permalink
Regenerate diracx client
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuwd committed Dec 16, 2024
1 parent 83dad27 commit 4c0346d
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 526 deletions.
6 changes: 0 additions & 6 deletions diracx-client/src/diracx/client/generated/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
AuthOperations,
ConfigOperations,
JobsOperations,
LollygagOperations,
WellKnownOperations,
)

Expand All @@ -35,8 +34,6 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
:vartype config: generated.operations.ConfigOperations
:ivar jobs: JobsOperations operations
:vartype jobs: generated.operations.JobsOperations
:ivar lollygag: LollygagOperations operations
:vartype lollygag: generated.operations.LollygagOperations
:keyword endpoint: Service URL. Required. Default value is "".
:paramtype endpoint: str
"""
Expand Down Expand Up @@ -88,9 +85,6 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self.jobs = JobsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.lollygag = LollygagOperations(
self._client, self._config, self._serialize, self._deserialize
)

def send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
Expand Down
6 changes: 0 additions & 6 deletions diracx-client/src/diracx/client/generated/aio/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
AuthOperations,
ConfigOperations,
JobsOperations,
LollygagOperations,
WellKnownOperations,
)

Expand All @@ -35,8 +34,6 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
:vartype config: generated.aio.operations.ConfigOperations
:ivar jobs: JobsOperations operations
:vartype jobs: generated.aio.operations.JobsOperations
:ivar lollygag: LollygagOperations operations
:vartype lollygag: generated.aio.operations.LollygagOperations
:keyword endpoint: Service URL. Required. Default value is "".
:paramtype endpoint: str
"""
Expand Down Expand Up @@ -88,9 +85,6 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
self.jobs = JobsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.lollygag = LollygagOperations(
self._client, self._config, self._serialize, self._deserialize
)

def send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from ._operations import AuthOperations # type: ignore
from ._operations import ConfigOperations # type: ignore
from ._operations import JobsOperations # type: ignore
from ._operations import LollygagOperations # type: ignore

from ._patch import __all__ as _patch_all
from ._patch import *
Expand All @@ -25,7 +24,6 @@
"AuthOperations",
"ConfigOperations",
"JobsOperations",
"LollygagOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
217 changes: 17 additions & 200 deletions diracx-client/src/diracx/client/generated/aio/operations/_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
build_jobs_summary_request,
build_jobs_unassign_bulk_jobs_sandboxes_request,
build_jobs_unassign_job_sandboxes_request,
build_lollygag_get_gubbins_secrets_request,
build_lollygag_get_owner_object_request,
build_lollygag_insert_owner_object_request,
build_well_known_installation_metadata_request,
build_well_known_openid_configuration_request,
)
Expand Down Expand Up @@ -140,13 +137,13 @@ async def openid_configuration(self, **kwargs: Any) -> Any:
return deserialized # type: ignore

@distributed_trace_async
async def installation_metadata(self, **kwargs: Any) -> _models.ExtendedMetadata:
async def installation_metadata(self, **kwargs: Any) -> _models.Metadata:
"""Installation Metadata.
Installation Metadata.
Get metadata about the dirac installation.
:return: ExtendedMetadata
:rtype: ~generated.models.ExtendedMetadata
:return: Metadata
:rtype: ~generated.models.Metadata
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
Expand All @@ -160,7 +157,7 @@ async def installation_metadata(self, **kwargs: Any) -> _models.ExtendedMetadata
_headers = kwargs.pop("headers", {}) or {}
_params = kwargs.pop("params", {}) or {}

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

_request = build_well_known_installation_metadata_request(
headers=_headers,
Expand All @@ -183,9 +180,7 @@ async def installation_metadata(self, **kwargs: Any) -> _models.ExtendedMetadata
)
raise HttpResponseError(response=response)

deserialized = self._deserialize(
"ExtendedMetadata", pipeline_response.http_response
)
deserialized = self._deserialize("Metadata", pipeline_response.http_response)

if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
Expand Down Expand Up @@ -1481,7 +1476,7 @@ async def set_job_statuses(
force: bool = False,
content_type: str = "application/json",
**kwargs: Any,
) -> Dict[str, _models.SetJobStatusReturn]:
) -> _models.SetJobStatusReturn:
"""Set Job Statuses.
Set Job Statuses.
Expand All @@ -1493,8 +1488,8 @@ async def set_job_statuses(
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:return: dict mapping str to SetJobStatusReturn
:rtype: dict[str, ~generated.models.SetJobStatusReturn]
:return: SetJobStatusReturn
:rtype: ~generated.models.SetJobStatusReturn
:raises ~azure.core.exceptions.HttpResponseError:
"""

Expand All @@ -1506,7 +1501,7 @@ async def set_job_statuses(
force: bool = False,
content_type: str = "application/json",
**kwargs: Any,
) -> Dict[str, _models.SetJobStatusReturn]:
) -> _models.SetJobStatusReturn:
"""Set Job Statuses.
Set Job Statuses.
Expand All @@ -1518,8 +1513,8 @@ async def set_job_statuses(
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:return: dict mapping str to SetJobStatusReturn
:rtype: dict[str, ~generated.models.SetJobStatusReturn]
:return: SetJobStatusReturn
:rtype: ~generated.models.SetJobStatusReturn
:raises ~azure.core.exceptions.HttpResponseError:
"""

Expand All @@ -1530,7 +1525,7 @@ async def set_job_statuses(
*,
force: bool = False,
**kwargs: Any,
) -> Dict[str, _models.SetJobStatusReturn]:
) -> _models.SetJobStatusReturn:
"""Set Job Statuses.
Set Job Statuses.
Expand All @@ -1539,8 +1534,8 @@ async def set_job_statuses(
:type body: dict[str, dict[str, ~generated.models.JobStatusUpdate]] or IO[bytes]
:keyword force: Default value is False.
:paramtype force: bool
:return: dict mapping str to SetJobStatusReturn
:rtype: dict[str, ~generated.models.SetJobStatusReturn]
:return: SetJobStatusReturn
:rtype: ~generated.models.SetJobStatusReturn
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
Expand All @@ -1557,7 +1552,7 @@ async def set_job_statuses(
content_type: Optional[str] = kwargs.pop(
"content_type", _headers.pop("Content-Type", None)
)
cls: ClsType[Dict[str, _models.SetJobStatusReturn]] = kwargs.pop("cls", None)
cls: ClsType[_models.SetJobStatusReturn] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
Expand Down Expand Up @@ -1593,7 +1588,7 @@ async def set_job_statuses(
raise HttpResponseError(response=response)

deserialized = self._deserialize(
"{SetJobStatusReturn}", pipeline_response.http_response
"SetJobStatusReturn", pipeline_response.http_response
)

if cls:
Expand Down Expand Up @@ -2026,181 +2021,3 @@ async def submit_bulk_jdl_jobs(
return cls(pipeline_response, deserialized, {}) # type: ignore

return deserialized # type: ignore


class LollygagOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~generated.aio.Dirac`'s
:attr:`lollygag` attribute.
"""

models = _models

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = (
input_args.pop(0) if input_args else kwargs.pop("deserializer")
)

@distributed_trace_async
async def insert_owner_object(self, owner_name: str, **kwargs: Any) -> Any:
"""Insert Owner Object.
Insert Owner Object.
:param owner_name: Required.
:type owner_name: str
:return: any
:rtype: any
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
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[Any] = kwargs.pop("cls", None)

_request = build_lollygag_insert_owner_object_request(
owner_name=owner_name,
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]:
map_error(
status_code=response.status_code, response=response, error_map=error_map
)
raise HttpResponseError(response=response)

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

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

return deserialized # type: ignore

@distributed_trace_async
async def get_owner_object(self, **kwargs: Any) -> Any:
"""Get Owner Object.
Get Owner Object.
:return: any
:rtype: any
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
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[Any] = kwargs.pop("cls", None)

_request = build_lollygag_get_owner_object_request(
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]:
map_error(
status_code=response.status_code, response=response, error_map=error_map
)
raise HttpResponseError(response=response)

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

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

return deserialized # type: ignore

@distributed_trace_async
async def get_gubbins_secrets(self, **kwargs: Any) -> Any:
"""Get Gubbins Secrets.
Does nothing but expects a GUBBINS_SENSEI permission.
:return: any
:rtype: any
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
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[Any] = kwargs.pop("cls", None)

_request = build_lollygag_get_gubbins_secrets_request(
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]:
map_error(
status_code=response.status_code, response=response, error_map=error_map
)
raise HttpResponseError(response=response)

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

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

return deserialized # type: ignore
Loading

0 comments on commit 4c0346d

Please sign in to comment.