flexmeasures.api.common.schemas.sensors
Classes
- class flexmeasures.api.common.schemas.sensors.SensorEntityAddressField(entity_type: str = 'sensor', fm_scheme: str = 'fm1', *args, **kwargs)
Deprecated: Entity addresses are not needed in the API anymore. Field that de-serializes to a Sensor, and serializes a Sensor into an entity address (string).
- __init__(entity_type: str = 'sensor', fm_scheme: str = 'fm1', *args, **kwargs)
- Parameters:
entity_type – “sensor” (in the future, possibly also another type of resource that is assigned an entity address)
fm_scheme – “fm0” or “fm1”
- class flexmeasures.api.common.schemas.sensors.SensorId(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
- class flexmeasures.api.common.schemas.sensors.SensorIdField(*, strict: bool = False, as_string: bool = False, **kwargs: Unpack[_BaseFieldKwargs])
Field that represents a sensor ID. It de-serializes from the sensor id to a sensor instance.
- _deserialize(value: Any, attr, data, **kwargs) Sensor
Deserialize value. Concrete
Fieldclasses should implement this method.- Parameters:
value – The value to be deserialized.
attr – The attribute/key in data to be deserialized.
data – The raw input data passed to the Schema.load <marshmallow.Schema.load>.
kwargs – Field-specific keyword arguments.
- Raises:
ValidationError – In case of formatting or validation failure.
- Returns:
The deserialized value.
Changed in version 3.0.0: Added
**kwargsto signature.
Exceptions
- exception flexmeasures.api.common.schemas.sensors.EntityAddressValidationError(message: str | list | dict, field_name: str = '_schema', data: Mapping[str, Any] | Iterable[Mapping[str, Any]] | None = None, valid_data: list[Any] | dict[str, Any] | None = None, **kwargs)