Skip to content

Commit 79a11cf

Browse files
fix: Fixed dependency and client
1 parent 8c45582 commit 79a11cf

File tree

9 files changed

+197
-603
lines changed

9 files changed

+197
-603
lines changed

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

Lines changed: 22 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,52 +2775,14 @@ async def add_pilot_stamps(
27752775

27762776
return deserialized # type: ignore
27772777

2778-
@overload
2779-
async def delete_pilots(
2780-
self, body: List[str], *, content_type: str = "application/json", **kwargs: Any
2781-
) -> None:
2782-
"""Delete Pilots.
2783-
2784-
Endpoint to delete a pilot.
2785-
2786-
:param body: Required.
2787-
:type body: list[str]
2788-
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2789-
Default value is "application/json".
2790-
:paramtype content_type: str
2791-
:return: None
2792-
:rtype: None
2793-
:raises ~azure.core.exceptions.HttpResponseError:
2794-
"""
2795-
2796-
@overload
2797-
async def delete_pilots(
2798-
self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
2799-
) -> None:
2800-
"""Delete Pilots.
2801-
2802-
Endpoint to delete a pilot.
2803-
2804-
:param body: Required.
2805-
:type body: IO[bytes]
2806-
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2807-
Default value is "application/json".
2808-
:paramtype content_type: str
2809-
:return: None
2810-
:rtype: None
2811-
:raises ~azure.core.exceptions.HttpResponseError:
2812-
"""
2813-
28142778
@distributed_trace_async
2815-
async def delete_pilots(
2816-
self, body: Union[List[str], IO[bytes]], **kwargs: Any
2817-
) -> None:
2779+
async def delete_pilots(self, *, pilot_stamps: List[str], **kwargs: Any) -> None:
28182780
"""Delete Pilots.
28192781
28202782
Endpoint to delete a pilot.
28212783
2822-
:param body: Is either a [str] type or a IO[bytes] type. Required.
2823-
:type body: list[str] or IO[bytes]
2784+
:keyword pilot_stamps: Stamps of the pilots we want to delete. Required.
2785+
:paramtype pilot_stamps: list[str]
28242786
:return: None
28252787
:rtype: None
28262788
:raises ~azure.core.exceptions.HttpResponseError:
@@ -2833,26 +2795,13 @@ async def delete_pilots(
28332795
}
28342796
error_map.update(kwargs.pop("error_map", {}) or {})
28352797

2836-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2798+
_headers = kwargs.pop("headers", {}) or {}
28372799
_params = kwargs.pop("params", {}) or {}
28382800

2839-
content_type: Optional[str] = kwargs.pop(
2840-
"content_type", _headers.pop("Content-Type", None)
2841-
)
28422801
cls: ClsType[None] = kwargs.pop("cls", None)
28432802

2844-
content_type = content_type or "application/json"
2845-
_json = None
2846-
_content = None
2847-
if isinstance(body, (IOBase, bytes)):
2848-
_content = body
2849-
else:
2850-
_json = self._serialize.body(body, "[str]")
2851-
28522803
_request = build_pilots_delete_pilots_request(
2853-
content_type=content_type,
2854-
json=_json,
2855-
content=_content,
2804+
pilot_stamps=pilot_stamps,
28562805
headers=_headers,
28572806
params=_params,
28582807
)
@@ -2876,56 +2825,21 @@ async def delete_pilots(
28762825
if cls:
28772826
return cls(pipeline_response, None, {}) # type: ignore
28782827

2879-
@overload
2880-
async def clear_pilots(
2881-
self,
2882-
body: _models.BodyPilotsClearPilots,
2883-
*,
2884-
content_type: str = "application/json",
2885-
**kwargs: Any,
2886-
) -> None:
2887-
"""Clear Pilots.
2888-
2889-
Delete all pilots that lived more than age_in_days.
2890-
2891-
:param body: Required.
2892-
:type body: ~_generated.models.BodyPilotsClearPilots
2893-
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
2894-
Default value is "application/json".
2895-
:paramtype content_type: str
2896-
:return: None
2897-
:rtype: None
2898-
:raises ~azure.core.exceptions.HttpResponseError:
2899-
"""
2900-
2901-
@overload
2902-
async def clear_pilots(
2903-
self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
2904-
) -> None:
2905-
"""Clear Pilots.
2906-
2907-
Delete all pilots that lived more than age_in_days.
2908-
2909-
:param body: Required.
2910-
:type body: IO[bytes]
2911-
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
2912-
Default value is "application/json".
2913-
:paramtype content_type: str
2914-
:return: None
2915-
:rtype: None
2916-
:raises ~azure.core.exceptions.HttpResponseError:
2917-
"""
2918-
29192828
@distributed_trace_async
29202829
async def clear_pilots(
2921-
self, body: Union[_models.BodyPilotsClearPilots, IO[bytes]], **kwargs: Any
2830+
self, *, age_in_days: int, delete_only_aborted: bool = True, **kwargs: Any
29222831
) -> None:
29232832
"""Clear Pilots.
29242833
29252834
Delete all pilots that lived more than age_in_days.
29262835
2927-
:param body: Is either a BodyPilotsClearPilots type or a IO[bytes] type. Required.
2928-
:type body: ~_generated.models.BodyPilotsClearPilots or IO[bytes]
2836+
:keyword age_in_days: The number of days that define the maximum age of pilots to be
2837+
deleted.Pilots older than this age will be considered for deletion. Required.
2838+
:paramtype age_in_days: int
2839+
:keyword delete_only_aborted: Flag indicating whether to only delete pilots whose status is
2840+
'Aborted'.If set to True, only pilots with the 'Aborted' status will be deleted.It is set by
2841+
default as True to avoid any mistake. Default value is True.
2842+
:paramtype delete_only_aborted: bool
29292843
:return: None
29302844
:rtype: None
29312845
:raises ~azure.core.exceptions.HttpResponseError:
@@ -2938,26 +2852,14 @@ async def clear_pilots(
29382852
}
29392853
error_map.update(kwargs.pop("error_map", {}) or {})
29402854

2941-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
2855+
_headers = kwargs.pop("headers", {}) or {}
29422856
_params = kwargs.pop("params", {}) or {}
29432857

2944-
content_type: Optional[str] = kwargs.pop(
2945-
"content_type", _headers.pop("Content-Type", None)
2946-
)
29472858
cls: ClsType[None] = kwargs.pop("cls", None)
29482859

2949-
content_type = content_type or "application/json"
2950-
_json = None
2951-
_content = None
2952-
if isinstance(body, (IOBase, bytes)):
2953-
_content = body
2954-
else:
2955-
_json = self._serialize.body(body, "BodyPilotsClearPilots")
2956-
29572860
_request = build_pilots_clear_pilots_request(
2958-
content_type=content_type,
2959-
json=_json,
2960-
content=_content,
2861+
age_in_days=age_in_days,
2862+
delete_only_aborted=delete_only_aborted,
29612863
headers=_headers,
29622864
params=_params,
29632865
)
@@ -3350,7 +3252,7 @@ async def associate_pilots_with_secrets(
33503252
@overload
33513253
async def update_pilot_fields(
33523254
self,
3353-
body: List[_models.PilotFieldsMapping],
3255+
body: _models.BodyPilotsUpdatePilotFields,
33543256
*,
33553257
content_type: str = "application/json",
33563258
**kwargs: Any,
@@ -3360,7 +3262,7 @@ async def update_pilot_fields(
33603262
Modify a field of a pilot.
33613263
33623264
:param body: Required.
3363-
:type body: list[~_generated.models.PilotFieldsMapping]
3265+
:type body: ~_generated.models.BodyPilotsUpdatePilotFields
33643266
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
33653267
Default value is "application/json".
33663268
:paramtype content_type: str
@@ -3389,14 +3291,14 @@ async def update_pilot_fields(
33893291

33903292
@distributed_trace_async
33913293
async def update_pilot_fields(
3392-
self, body: Union[List[_models.PilotFieldsMapping], IO[bytes]], **kwargs: Any
3294+
self, body: Union[_models.BodyPilotsUpdatePilotFields, IO[bytes]], **kwargs: Any
33933295
) -> None:
33943296
"""Update Pilot Fields.
33953297
33963298
Modify a field of a pilot.
33973299
3398-
:param body: Is either a [PilotFieldsMapping] type or a IO[bytes] type. Required.
3399-
:type body: list[~_generated.models.PilotFieldsMapping] or IO[bytes]
3300+
:param body: Is either a BodyPilotsUpdatePilotFields type or a IO[bytes] type. Required.
3301+
:type body: ~_generated.models.BodyPilotsUpdatePilotFields or IO[bytes]
34003302
:return: None
34013303
:rtype: None
34023304
:raises ~azure.core.exceptions.HttpResponseError:
@@ -3423,7 +3325,7 @@ async def update_pilot_fields(
34233325
if isinstance(body, (IOBase, bytes)):
34243326
_content = body
34253327
else:
3426-
_json = self._serialize.body(body, "[PilotFieldsMapping]")
3328+
_json = self._serialize.body(body, "BodyPilotsUpdatePilotFields")
34273329

34283330
_request = build_pilots_update_pilot_fields_request(
34293331
content_type=content_type,

diracx-client/src/diracx/client/_generated/models/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
BodyPilotsAddPilotStamps,
2020
BodyPilotsAssociatePilotWithJobs,
2121
BodyPilotsAssociatePilotsWithSecrets,
22-
BodyPilotsClearPilots,
2322
BodyPilotsCreatePilotSecrets,
23+
BodyPilotsUpdatePilotFields,
2424
GroupInfo,
2525
HTTPValidationError,
2626
HeartbeatData,
@@ -79,8 +79,8 @@
7979
"BodyPilotsAddPilotStamps",
8080
"BodyPilotsAssociatePilotWithJobs",
8181
"BodyPilotsAssociatePilotsWithSecrets",
82-
"BodyPilotsClearPilots",
8382
"BodyPilotsCreatePilotSecrets",
83+
"BodyPilotsUpdatePilotFields",
8484
"GroupInfo",
8585
"HTTPValidationError",
8686
"HeartbeatData",

diracx-client/src/diracx/client/_generated/models/_models.py

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -295,46 +295,6 @@ def __init__(
295295
self.pilot_jobs_ids = pilot_jobs_ids
296296

297297

298-
class BodyPilotsClearPilots(_serialization.Model):
299-
"""Body_pilots_clear_pilots.
300-
301-
All required parameters must be populated in order to send to server.
302-
303-
:ivar age_in_days: The number of days that define the maximum age of pilots to be
304-
deleted.Pilots older than this age will be considered for deletion. Required.
305-
:vartype age_in_days: int
306-
:ivar delete_only_aborted: Flag indicating whether to only delete pilots whose status is
307-
'Aborted'.If set to True, only pilots with the 'Aborted' status will be deleted.It is set by
308-
default as True to avoid any mistake.
309-
:vartype delete_only_aborted: bool
310-
"""
311-
312-
_validation = {
313-
"age_in_days": {"required": True},
314-
}
315-
316-
_attribute_map = {
317-
"age_in_days": {"key": "age_in_days", "type": "int"},
318-
"delete_only_aborted": {"key": "delete_only_aborted", "type": "bool"},
319-
}
320-
321-
def __init__(
322-
self, *, age_in_days: int, delete_only_aborted: bool = True, **kwargs: Any
323-
) -> None:
324-
"""
325-
:keyword age_in_days: The number of days that define the maximum age of pilots to be
326-
deleted.Pilots older than this age will be considered for deletion. Required.
327-
:paramtype age_in_days: int
328-
:keyword delete_only_aborted: Flag indicating whether to only delete pilots whose status is
329-
'Aborted'.If set to True, only pilots with the 'Aborted' status will be deleted.It is set by
330-
default as True to avoid any mistake.
331-
:paramtype delete_only_aborted: bool
332-
"""
333-
super().__init__(**kwargs)
334-
self.age_in_days = age_in_days
335-
self.delete_only_aborted = delete_only_aborted
336-
337-
338298
class BodyPilotsCreatePilotSecrets(_serialization.Model):
339299
"""Body_pilots_create_pilot_secrets.
340300
@@ -393,6 +353,41 @@ def __init__(
393353
self.pilot_secret_use_count_max = pilot_secret_use_count_max
394354

395355

356+
class BodyPilotsUpdatePilotFields(_serialization.Model):
357+
"""Body_pilots_update_pilot_fields.
358+
359+
All required parameters must be populated in order to send to server.
360+
361+
:ivar pilot_stamps_to_fields_mapping: (pilot_stamp, pilot_fields) mapping to change. Required.
362+
:vartype pilot_stamps_to_fields_mapping: list[~_generated.models.PilotFieldsMapping]
363+
"""
364+
365+
_validation = {
366+
"pilot_stamps_to_fields_mapping": {"required": True},
367+
}
368+
369+
_attribute_map = {
370+
"pilot_stamps_to_fields_mapping": {
371+
"key": "pilot_stamps_to_fields_mapping",
372+
"type": "[PilotFieldsMapping]",
373+
},
374+
}
375+
376+
def __init__(
377+
self,
378+
*,
379+
pilot_stamps_to_fields_mapping: List["_models.PilotFieldsMapping"],
380+
**kwargs: Any,
381+
) -> None:
382+
"""
383+
:keyword pilot_stamps_to_fields_mapping: (pilot_stamp, pilot_fields) mapping to change.
384+
Required.
385+
:paramtype pilot_stamps_to_fields_mapping: list[~_generated.models.PilotFieldsMapping]
386+
"""
387+
super().__init__(**kwargs)
388+
self.pilot_stamps_to_fields_mapping = pilot_stamps_to_fields_mapping
389+
390+
396391
class GroupInfo(_serialization.Model):
397392
"""GroupInfo.
398393

0 commit comments

Comments
 (0)