3from basyx.aas.model
import Key, KeyTypes, ModelReference
4from pydantic
import BaseModel, Field, PrivateAttr
6KEY_TYPE_MAPPING: dict[str, str] = {
7 "Submodel":
"SUBMODEL",
8 "SubmodelElementCollection":
"SUBMODEL_ELEMENT_COLLECTION",
9 "Property":
"PROPERTY",
14 """Defines the model class of the payload for the `get_value` (URL `/get-value`) endpoint
15 of this application using Pydantic.
17 The JSON payload must contain exactly the following fields:
20 Inside the `Reference`-field, a properly serialized AAS reference according to the AAS JSON serialization
22 Will be parsed as `basyx.aas.model.ModelReference`.
23 The reference shall point to a SME in an AID submodel known to this application (refer to `add_or_update_config`).
29 "type": "ModelReference",
33 "value": "https://fluid40.de/ids/sm/4757_4856_8464_1441"
36 "type": "SubmodelElementCollection",
37 "value": "Interface_MQTT"
40 "type": "SubmodelElementCollection",
41 "value": "InteractionMetadata"
44 "type": "SubmodelElementCollection",
48 "type": "SubmodelElementCollection",
49 "value": "my_endpoint"
57 aid_ref_dict: dict = Field(..., alias=
"Reference")
58 _aid_ref: ModelReference = PrivateAttr(default=
None)
68 raise ValueError(
"AID Reference has not been initialized.")
70 ref: ModelReference = ModelReference(key=tuple(key_list), type_=ModelReference)
74 key_type = KEY_TYPE_MAPPING.get(key_str)
76 raise ValueError(f
"Unknown key type: {key_str}")
77 return KeyTypes[key_type]
Defines the model class of the payload for the get_value (URL /get-value) endpoint of this applicatio...
KeyTypes _get_key_type(self, str key_str)
__init__(self, **Any data)
ModelReference _build_model_reference(self)