Skip to content

Commit 1278894

Browse files
fstagnialdbr
authored andcommitted
chore: regenerate client
1 parent 2c63e7c commit 1278894

13 files changed

Lines changed: 52 additions & 102 deletions

File tree

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,7 +2451,7 @@ async def add_pilot_stamps(self, body: Union[_models.BodyPilotsAddPilotStamps, I
24512451
async def delete_pilots(
24522452
self,
24532453
*,
2454-
pilot_stamps: Optional[List[str]] = None,
2454+
pilot_stamps: Optional[list[str]] = None,
24552455
age_in_days: Optional[int] = None,
24562456
delete_only_aborted: bool = False,
24572457
**kwargs: Any
@@ -2622,7 +2622,7 @@ async def update_pilot_fields(
26222622
@distributed_trace_async
26232623
async def get_pilot_jobs(
26242624
self, *, pilot_stamp: Optional[str] = None, job_id: Optional[int] = None, **kwargs: Any
2625-
) -> List[int]:
2625+
) -> list[int]:
26262626
"""Get Pilot Jobs.
26272627
26282628
Endpoint only for admins, to get jobs of a pilot.
@@ -2646,7 +2646,7 @@ async def get_pilot_jobs(
26462646
_headers = kwargs.pop("headers", {}) or {}
26472647
_params = kwargs.pop("params", {}) or {}
26482648

2649-
cls: ClsType[List[int]] = kwargs.pop("cls", None)
2649+
cls: ClsType[list[int]] = kwargs.pop("cls", None)
26502650

26512651
_request = build_pilots_get_pilot_jobs_request(
26522652
pilot_stamp=pilot_stamp,
@@ -2683,7 +2683,7 @@ async def search(
26832683
per_page: int = 100,
26842684
content_type: str = "application/json",
26852685
**kwargs: Any
2686-
) -> List[Dict[str, Any]]:
2686+
) -> list[dict[str, Any]]:
26872687
"""Search.
26882688
26892689
Retrieve information about pilots.
@@ -2711,7 +2711,7 @@ async def search(
27112711
per_page: int = 100,
27122712
content_type: str = "application/json",
27132713
**kwargs: Any
2714-
) -> List[Dict[str, Any]]:
2714+
) -> list[dict[str, Any]]:
27152715
"""Search.
27162716
27172717
Retrieve information about pilots.
@@ -2738,7 +2738,7 @@ async def search(
27382738
page: int = 1,
27392739
per_page: int = 100,
27402740
**kwargs: Any
2741-
) -> List[Dict[str, Any]]:
2741+
) -> list[dict[str, Any]]:
27422742
"""Search.
27432743
27442744
Retrieve information about pilots.
@@ -2765,9 +2765,10 @@ async def search(
27652765
_params = kwargs.pop("params", {}) or {}
27662766

27672767
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
2768-
cls: ClsType[List[Dict[str, Any]]] = kwargs.pop("cls", None)
2768+
content_type = content_type if body else None
2769+
cls: ClsType[list[dict[str, Any]]] = kwargs.pop("cls", None)
27692770

2770-
content_type = content_type or "application/json"
2771+
content_type = content_type or "application/json" if body else None
27712772
_json = None
27722773
_content = None
27732774
if isinstance(body, (IOBase, bytes)):

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@
66
77
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
88
"""
9+
910
from __future__ import annotations
1011

1112
__all__ = [
1213
"AuthOperations",
1314
"JobsOperations",
14-
"PilotsOperations",
1515
] # Add all objects you want publicly available to users at this package level
1616

1717
from ....patches.auth.aio import AuthOperations
1818
from ....patches.jobs.aio import JobsOperations
19-
from ....patches.pilots.aio import PilotsOperations
19+
20+
try:
21+
from ....patches.pilots.aio import PilotsOperations
22+
23+
__all__.append("PilotsOperations")
24+
except ImportError:
25+
pass
2026

2127

2228
def patch_sdk():

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

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
77

8-
from collections.abc import MutableMapping
98
import datetime
109
from typing import Any, Optional, TYPE_CHECKING, Union
1110

1211
from .._utils import serialization as _serialization
1312

1413
if TYPE_CHECKING:
1514
from .. import models as _models
16-
JSON = MutableMapping[str, Any]
1715

1816

1917
class BodyAuthGetOidcToken(_serialization.Model):
@@ -224,12 +222,12 @@ class BodyPilotsAddPilotStamps(_serialization.Model):
224222
def __init__(
225223
self,
226224
*,
227-
pilot_stamps: List[str],
225+
pilot_stamps: list[str],
228226
vo: str,
229227
grid_type: str = "Dirac",
230228
grid_site: str = "Unknown",
231229
destination_site: str = "NotAssigned",
232-
pilot_references: Optional[Dict[str, str]] = None,
230+
pilot_references: Optional[dict[str, str]] = None,
233231
pilot_status: Optional[Union[str, "_models.PilotStatus"]] = None,
234232
**kwargs: Any
235233
) -> None:
@@ -277,7 +275,7 @@ class BodyPilotsUpdatePilotFields(_serialization.Model):
277275
"pilot_stamps_to_fields_mapping": {"key": "pilot_stamps_to_fields_mapping", "type": "[PilotFieldsMapping]"},
278276
}
279277

280-
def __init__(self, *, pilot_stamps_to_fields_mapping: List["_models.PilotFieldsMapping"], **kwargs: Any) -> None:
278+
def __init__(self, *, pilot_stamps_to_fields_mapping: list["_models.PilotFieldsMapping"], **kwargs: Any) -> None:
281279
"""
282280
:keyword pilot_stamps_to_fields_mapping: (pilot_stamp, pilot_fields) mapping to change.
283281
Required.
@@ -1706,10 +1704,6 @@ class ValidationError(_serialization.Model):
17061704
:vartype msg: str
17071705
:ivar type: Error Type. Required.
17081706
:vartype type: str
1709-
:ivar input: Input.
1710-
:vartype input: any
1711-
:ivar ctx: Context.
1712-
:vartype ctx: JSON
17131707
"""
17141708

17151709
_validation = {
@@ -1722,38 +1716,21 @@ class ValidationError(_serialization.Model):
17221716
"loc": {"key": "loc", "type": "[object]"},
17231717
"msg": {"key": "msg", "type": "str"},
17241718
"type": {"key": "type", "type": "str"},
1725-
"input": {"key": "input", "type": "object"},
1726-
"ctx": {"key": "ctx", "type": "object"},
17271719
}
17281720

1729-
def __init__(
1730-
self,
1731-
*,
1732-
loc: list[Any],
1733-
msg: str,
1734-
type: str,
1735-
input: Optional[Any] = None,
1736-
ctx: Optional[JSON] = None,
1737-
**kwargs: Any
1738-
) -> None:
1721+
def __init__(self, *, loc: list[Any], msg: str, type: str, **kwargs: Any) -> None:
17391722
"""
17401723
:keyword loc: Location. Required.
17411724
:paramtype loc: list[any]
17421725
:keyword msg: Message. Required.
17431726
:paramtype msg: str
17441727
:keyword type: Error Type. Required.
17451728
:paramtype type: str
1746-
:keyword input: Input.
1747-
:paramtype input: any
1748-
:keyword ctx: Context.
1749-
:paramtype ctx: JSON
17501729
"""
17511730
super().__init__(**kwargs)
17521731
self.loc = loc
17531732
self.msg = msg
17541733
self.type = type
1755-
self.input = input
1756-
self.ctx = ctx
17571734

17581735

17591736
class VectorSearchSpec(_serialization.Model):

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def build_pilots_add_pilot_stamps_request(**kwargs: Any) -> HttpRequest:
584584

585585
def build_pilots_delete_pilots_request(
586586
*,
587-
pilot_stamps: Optional[List[str]] = None,
587+
pilot_stamps: Optional[list[str]] = None,
588588
age_in_days: Optional[int] = None,
589589
delete_only_aborted: bool = False,
590590
**kwargs: Any
@@ -3062,7 +3062,7 @@ def add_pilot_stamps(self, body: Union[_models.BodyPilotsAddPilotStamps, IO[byte
30623062
def delete_pilots( # pylint: disable=inconsistent-return-statements
30633063
self,
30643064
*,
3065-
pilot_stamps: Optional[List[str]] = None,
3065+
pilot_stamps: Optional[list[str]] = None,
30663066
age_in_days: Optional[int] = None,
30673067
delete_only_aborted: bool = False,
30683068
**kwargs: Any
@@ -3231,7 +3231,7 @@ def update_pilot_fields( # pylint: disable=inconsistent-return-statements
32313231
@distributed_trace
32323232
def get_pilot_jobs(
32333233
self, *, pilot_stamp: Optional[str] = None, job_id: Optional[int] = None, **kwargs: Any
3234-
) -> List[int]:
3234+
) -> list[int]:
32353235
"""Get Pilot Jobs.
32363236
32373237
Endpoint only for admins, to get jobs of a pilot.
@@ -3255,7 +3255,7 @@ def get_pilot_jobs(
32553255
_headers = kwargs.pop("headers", {}) or {}
32563256
_params = kwargs.pop("params", {}) or {}
32573257

3258-
cls: ClsType[List[int]] = kwargs.pop("cls", None)
3258+
cls: ClsType[list[int]] = kwargs.pop("cls", None)
32593259

32603260
_request = build_pilots_get_pilot_jobs_request(
32613261
pilot_stamp=pilot_stamp,
@@ -3292,7 +3292,7 @@ def search(
32923292
per_page: int = 100,
32933293
content_type: str = "application/json",
32943294
**kwargs: Any
3295-
) -> List[Dict[str, Any]]:
3295+
) -> list[dict[str, Any]]:
32963296
"""Search.
32973297
32983298
Retrieve information about pilots.
@@ -3320,7 +3320,7 @@ def search(
33203320
per_page: int = 100,
33213321
content_type: str = "application/json",
33223322
**kwargs: Any
3323-
) -> List[Dict[str, Any]]:
3323+
) -> list[dict[str, Any]]:
33243324
"""Search.
33253325
33263326
Retrieve information about pilots.
@@ -3347,7 +3347,7 @@ def search(
33473347
page: int = 1,
33483348
per_page: int = 100,
33493349
**kwargs: Any
3350-
) -> List[Dict[str, Any]]:
3350+
) -> list[dict[str, Any]]:
33513351
"""Search.
33523352
33533353
Retrieve information about pilots.
@@ -3374,9 +3374,10 @@ def search(
33743374
_params = kwargs.pop("params", {}) or {}
33753375

33763376
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
3377-
cls: ClsType[List[Dict[str, Any]]] = kwargs.pop("cls", None)
3377+
content_type = content_type if body else None
3378+
cls: ClsType[list[dict[str, Any]]] = kwargs.pop("cls", None)
33783379

3379-
content_type = content_type or "application/json"
3380+
content_type = content_type or "application/json" if body else None
33803381
_json = None
33813382
_content = None
33823383
if isinstance(body, (IOBase, bytes)):

diracx-client/src/diracx/client/_generated/operations/_patch.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@
66
77
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
88
"""
9+
910
from __future__ import annotations
1011

1112
__all__ = [
1213
"AuthOperations",
1314
"JobsOperations",
14-
"PilotsOperations",
1515
] # Add all objects you want publicly available to users at this package level
1616

1717
from ...patches.auth.sync import AuthOperations
1818
from ...patches.jobs.sync import JobsOperations
19-
from ...patches.pilots.sync import PilotsOperations
19+
20+
try:
21+
from ...patches.pilots.sync import PilotsOperations
22+
23+
__all__.append("PilotsOperations")
24+
except ImportError:
25+
pass
2026

2127

2228
def patch_sdk():

diracx-core/src/diracx/core/models/job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from __future__ import annotations
77

88
from enum import StrEnum
9-
from typing import Literal, Optional
9+
from typing import Literal
1010

1111
from pydantic import BaseModel, Field, field_validator
1212

diracx-core/src/diracx/core/models/search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
from datetime import datetime
34
from enum import StrEnum
45

56
from pydantic import BaseModel
@@ -24,7 +25,7 @@ class VectorSearchOperator(StrEnum):
2425
class ScalarSearchSpec(TypedDict):
2526
parameter: str
2627
operator: ScalarSearchOperator
27-
value: str | int
28+
value: str | int | datetime
2829

2930

3031
class VectorSearchSpec(TypedDict):

diracx-db/src/diracx/db/sql/dummy/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from sqlalchemy import insert
44
from uuid_utils import UUID
55

6-
from diracx.core.models import SearchSpec
6+
from diracx.core.models.search import SearchSpec
77
from diracx.db.sql.utils import BaseSQLDB
88

99
from .schema import Base as DummyDBBase

diracx-db/src/diracx/db/sql/pilots/db.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ async def add_jobs_to_pilot(self, job_to_pilot_mapping: list[dict[str, Any]]):
7676
"""Associate a pilot with jobs.
7777
7878
job_to_pilot_mapping format:
79-
```py
80-
job_to_pilot_mapping = [
81-
{"PilotID": pilot_id, "JobID": job_id, "StartTime": now}
82-
]
83-
```
79+
job_to_pilot_mapping = [{"PilotID": pilot_id, "JobID": job_id, "StartTime": now}]
8480
8581
Raises:
8682
- PilotNotFoundError if a pilot_id is not associated with a pilot.
@@ -144,7 +140,7 @@ async def update_pilot_fields(
144140
"""Bulk update pilots with a mapping.
145141
146142
pilot_stamps_to_fields_mapping format:
147-
```py
143+
148144
[
149145
{
150146
"PilotStamp": pilot_stamp,
@@ -157,7 +153,6 @@ async def update_pilot_fields(
157153
...
158154
}
159155
]
160-
```
161156
162157
The mapping helps to update multiple fields at a time.
163158

diracx-db/src/diracx/db/sql/pilots/schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
)
1212
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
1313

14+
from diracx.core.models.pilot import PilotStatus
1415
from diracx.db.sql.utils import (
1516
EnumBackedBool,
1617
str32,

0 commit comments

Comments
 (0)