Skip to content

Commit 5e80165

Browse files
fix: Autoresting
1 parent b21fd04 commit 5e80165

File tree

6 files changed

+329
-0
lines changed

6 files changed

+329
-0
lines changed

diracx-client/src/diracx/client/generated/_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
AuthOperations,
2020
ConfigOperations,
2121
JobsOperations,
22+
PilotsOperations,
2223
WellKnownOperations,
2324
)
2425

@@ -34,6 +35,8 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
3435
:vartype config: generated.operations.ConfigOperations
3536
:ivar jobs: JobsOperations operations
3637
:vartype jobs: generated.operations.JobsOperations
38+
:ivar pilots: PilotsOperations operations
39+
:vartype pilots: generated.operations.PilotsOperations
3740
:keyword endpoint: Service URL. Required. Default value is "".
3841
:paramtype endpoint: str
3942
"""
@@ -85,6 +88,9 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
8588
self.jobs = JobsOperations(
8689
self._client, self._config, self._serialize, self._deserialize
8790
)
91+
self.pilots = PilotsOperations(
92+
self._client, self._config, self._serialize, self._deserialize
93+
)
8894

8995
def send_request(
9096
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any

diracx-client/src/diracx/client/generated/aio/_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
AuthOperations,
2020
ConfigOperations,
2121
JobsOperations,
22+
PilotsOperations,
2223
WellKnownOperations,
2324
)
2425

@@ -34,6 +35,8 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
3435
:vartype config: generated.aio.operations.ConfigOperations
3536
:ivar jobs: JobsOperations operations
3637
:vartype jobs: generated.aio.operations.JobsOperations
38+
:ivar pilots: PilotsOperations operations
39+
:vartype pilots: generated.aio.operations.PilotsOperations
3740
:keyword endpoint: Service URL. Required. Default value is "".
3841
:paramtype endpoint: str
3942
"""
@@ -85,6 +88,9 @@ def __init__( # pylint: disable=missing-client-constructor-parameter-credential
8588
self.jobs = JobsOperations(
8689
self._client, self._config, self._serialize, self._deserialize
8790
)
91+
self.pilots = PilotsOperations(
92+
self._client, self._config, self._serialize, self._deserialize
93+
)
8894

8995
def send_request(
9096
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any

diracx-client/src/diracx/client/generated/aio/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from ._operations import AuthOperations # type: ignore
1515
from ._operations import ConfigOperations # type: ignore
1616
from ._operations import JobsOperations # type: ignore
17+
from ._operations import PilotsOperations # type: ignore
1718

1819
from ._patch import __all__ as _patch_all
1920
from ._patch import *
@@ -24,6 +25,7 @@
2425
"AuthOperations",
2526
"ConfigOperations",
2627
"JobsOperations",
28+
"PilotsOperations",
2729
]
2830
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2931
_patch_sdk()

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

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
build_auth_get_refresh_tokens_request,
3434
build_auth_initiate_authorization_flow_request,
3535
build_auth_initiate_device_flow_request,
36+
build_auth_pilot_login_request,
3637
build_auth_revoke_refresh_token_request,
3738
build_auth_userinfo_request,
3839
build_config_serve_config_request,
@@ -50,6 +51,7 @@
5051
build_jobs_summary_request,
5152
build_jobs_unassign_bulk_jobs_sandboxes_request,
5253
build_jobs_unassign_job_sandboxes_request,
54+
build_pilots_get_pilot_info_request,
5355
build_well_known_get_installation_metadata_request,
5456
build_well_known_get_openid_configuration_request,
5557
)
@@ -823,6 +825,65 @@ async def complete_authorization_flow(
823825

824826
return deserialized # type: ignore
825827

828+
@distributed_trace_async
829+
async def pilot_login(
830+
self, *, pilot_id: int, pilot_secret: str, **kwargs: Any
831+
) -> Any:
832+
"""Pilot Login.
833+
834+
Endpoint without policy, the pilot uses only its secret.
835+
836+
:keyword pilot_id: Required.
837+
:paramtype pilot_id: int
838+
:keyword pilot_secret: Required.
839+
:paramtype pilot_secret: str
840+
:return: any
841+
:rtype: any
842+
:raises ~azure.core.exceptions.HttpResponseError:
843+
"""
844+
error_map: MutableMapping = {
845+
401: ClientAuthenticationError,
846+
404: ResourceNotFoundError,
847+
409: ResourceExistsError,
848+
304: ResourceNotModifiedError,
849+
}
850+
error_map.update(kwargs.pop("error_map", {}) or {})
851+
852+
_headers = kwargs.pop("headers", {}) or {}
853+
_params = kwargs.pop("params", {}) or {}
854+
855+
cls: ClsType[Any] = kwargs.pop("cls", None)
856+
857+
_request = build_auth_pilot_login_request(
858+
pilot_id=pilot_id,
859+
pilot_secret=pilot_secret,
860+
headers=_headers,
861+
params=_params,
862+
)
863+
_request.url = self._client.format_url(_request.url)
864+
865+
_stream = False
866+
pipeline_response: PipelineResponse = (
867+
await self._client._pipeline.run( # pylint: disable=protected-access
868+
_request, stream=_stream, **kwargs
869+
)
870+
)
871+
872+
response = pipeline_response.http_response
873+
874+
if response.status_code not in [200]:
875+
map_error(
876+
status_code=response.status_code, response=response, error_map=error_map
877+
)
878+
raise HttpResponseError(response=response)
879+
880+
deserialized = self._deserialize("object", pipeline_response.http_response)
881+
882+
if cls:
883+
return cls(pipeline_response, deserialized, {}) # type: ignore
884+
885+
return deserialized # type: ignore
886+
826887

827888
class ConfigOperations:
828889
"""
@@ -2156,3 +2217,82 @@ async def submit_jdl_jobs(
21562217
return cls(pipeline_response, deserialized, {}) # type: ignore
21572218

21582219
return deserialized # type: ignore
2220+
2221+
2222+
class PilotsOperations:
2223+
"""
2224+
.. warning::
2225+
**DO NOT** instantiate this class directly.
2226+
2227+
Instead, you should access the following operations through
2228+
:class:`~generated.aio.Dirac`'s
2229+
:attr:`pilots` attribute.
2230+
"""
2231+
2232+
models = _models
2233+
2234+
def __init__(self, *args, **kwargs) -> None:
2235+
input_args = list(args)
2236+
self._client: AsyncPipelineClient = (
2237+
input_args.pop(0) if input_args else kwargs.pop("client")
2238+
)
2239+
self._config: DiracConfiguration = (
2240+
input_args.pop(0) if input_args else kwargs.pop("config")
2241+
)
2242+
self._serialize: Serializer = (
2243+
input_args.pop(0) if input_args else kwargs.pop("serializer")
2244+
)
2245+
self._deserialize: Deserializer = (
2246+
input_args.pop(0) if input_args else kwargs.pop("deserializer")
2247+
)
2248+
2249+
@distributed_trace_async
2250+
async def get_pilot_info(self, **kwargs: Any) -> Any:
2251+
"""Get Pilot Info.
2252+
2253+
Get Pilot Info.
2254+
2255+
:return: any
2256+
:rtype: any
2257+
:raises ~azure.core.exceptions.HttpResponseError:
2258+
"""
2259+
error_map: MutableMapping = {
2260+
401: ClientAuthenticationError,
2261+
404: ResourceNotFoundError,
2262+
409: ResourceExistsError,
2263+
304: ResourceNotModifiedError,
2264+
}
2265+
error_map.update(kwargs.pop("error_map", {}) or {})
2266+
2267+
_headers = kwargs.pop("headers", {}) or {}
2268+
_params = kwargs.pop("params", {}) or {}
2269+
2270+
cls: ClsType[Any] = kwargs.pop("cls", None)
2271+
2272+
_request = build_pilots_get_pilot_info_request(
2273+
headers=_headers,
2274+
params=_params,
2275+
)
2276+
_request.url = self._client.format_url(_request.url)
2277+
2278+
_stream = False
2279+
pipeline_response: PipelineResponse = (
2280+
await self._client._pipeline.run( # pylint: disable=protected-access
2281+
_request, stream=_stream, **kwargs
2282+
)
2283+
)
2284+
2285+
response = pipeline_response.http_response
2286+
2287+
if response.status_code not in [200]:
2288+
map_error(
2289+
status_code=response.status_code, response=response, error_map=error_map
2290+
)
2291+
raise HttpResponseError(response=response)
2292+
2293+
deserialized = self._deserialize("object", pipeline_response.http_response)
2294+
2295+
if cls:
2296+
return cls(pipeline_response, deserialized, {}) # type: ignore
2297+
2298+
return deserialized # type: ignore

diracx-client/src/diracx/client/generated/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from ._operations import AuthOperations # type: ignore
1515
from ._operations import ConfigOperations # type: ignore
1616
from ._operations import JobsOperations # type: ignore
17+
from ._operations import PilotsOperations # type: ignore
1718

1819
from ._patch import __all__ as _patch_all
1920
from ._patch import *
@@ -24,6 +25,7 @@
2425
"AuthOperations",
2526
"ConfigOperations",
2627
"JobsOperations",
28+
"PilotsOperations",
2729
]
2830
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2931
_patch_sdk()

0 commit comments

Comments
 (0)