|
1 | 1 | from datetime import datetime |
2 | | -from typing import Annotated, Any, TypeAlias |
| 2 | +from typing import Any, TypeAlias |
3 | 3 |
|
4 | 4 | from models_library.rpc_pagination import PageRpc |
5 | 5 | from pydantic import BaseModel, ConfigDict, Field, HttpUrl, NonNegativeInt |
|
22 | 22 | from ..services_types import ServiceKey, ServiceVersion |
23 | 23 | from ..utils.change_case import snake_to_camel |
24 | 24 |
|
25 | | - |
26 | | -class ServiceUpdate(ServiceMetaDataEditable, ServiceAccessRights): |
27 | | - |
28 | | - thumbnail: Annotated[str, HttpUrl] | None = None |
29 | | - icon: HttpUrl | None = None |
30 | | - |
31 | | - @staticmethod |
32 | | - def _update_json_schema_extra(schema: JsonDict) -> None: |
33 | | - schema.update( |
34 | | - { |
35 | | - "example": { |
36 | | - # ServiceAccessRights |
37 | | - "accessRights": { |
38 | | - 1: { |
39 | | - "execute_access": False, |
40 | | - "write_access": False, |
41 | | - }, # type: ignore[dict-item] |
42 | | - 2: { |
43 | | - "execute_access": True, |
44 | | - "write_access": True, |
45 | | - }, # type: ignore[dict-item] |
46 | | - 44: { |
47 | | - "execute_access": False, |
48 | | - "write_access": False, |
49 | | - }, # type: ignore[dict-item] |
50 | | - }, |
51 | | - # ServiceMetaData = ServiceCommonData + |
52 | | - "name": "My Human Readable Service Name", |
53 | | - "thumbnail": None, |
54 | | - "description": "An interesting service that does something", |
55 | | - "classifiers": ["RRID:SCR_018997", "RRID:SCR_019001"], |
56 | | - "quality": { |
57 | | - "tsr": { |
58 | | - "r01": {"level": 3, "references": ""}, |
59 | | - "r02": {"level": 2, "references": ""}, |
60 | | - "r03": {"level": 0, "references": ""}, |
61 | | - "r04": {"level": 0, "references": ""}, |
62 | | - "r05": {"level": 2, "references": ""}, |
63 | | - "r06": {"level": 0, "references": ""}, |
64 | | - "r07": {"level": 0, "references": ""}, |
65 | | - "r08": {"level": 1, "references": ""}, |
66 | | - "r09": {"level": 0, "references": ""}, |
67 | | - "r10": {"level": 0, "references": ""}, |
68 | | - }, |
69 | | - "enabled": True, |
70 | | - "annotations": { |
71 | | - "vandv": "", |
72 | | - "purpose": "", |
73 | | - "standards": "", |
74 | | - "limitations": "", |
75 | | - "documentation": "", |
76 | | - "certificationLink": "", |
77 | | - "certificationStatus": "Uncertified", |
78 | | - }, |
79 | | - }, |
80 | | - } |
81 | | - } |
82 | | - ) |
83 | | - |
84 | | - model_config = ConfigDict(json_schema_extra=_update_json_schema_extra) |
85 | | - |
86 | | - |
87 | 25 | _EXAMPLE_FILEPICKER: dict[str, Any] = { |
88 | 26 | "name": "File Picker", |
89 | 27 | "thumbnail": None, |
|
0 commit comments