Source code for kelvin.message.typing
"""Type aliases for Kelvin message types.
This module provides typed message classes that combine specific resource types
with message data types for improved type checking and IDE support.
Main Components:
AssetDataMessage: Message with asset datastream resource.
AssetDataQualityMessage: Message with asset data quality resource.
AssetDataStreamDataQualityMessage: Message with asset datastream data quality resource.
"""
from __future__ import annotations
from kelvin.krn import KRNAssetDataQuality, KRNAssetDataStream, KRNAssetDataStreamDataQuality
from kelvin.message import KMessageTypeData, Message
[docs]
class AssetDataMessage(Message):
"""A message containing data for an asset datastream.
This type represents messages that carry data values (numbers, strings, booleans)
for a specific datastream on an asset.
Attributes:
type: The data message type (includes primitive type information).
resource: The KRN identifying the asset and datastream.
"""
type: KMessageTypeData
resource: KRNAssetDataStream
[docs]
class AssetDataQualityMessage(Message):
"""A message containing data quality information for an asset.
Attributes:
type: The data message type.
resource: The KRN identifying the asset and data quality metric.
"""
type: KMessageTypeData
resource: KRNAssetDataQuality
[docs]
class AssetDataStreamDataQualityMessage(Message):
"""A message containing data quality information for a specific asset datastream.
Attributes:
type: The data message type.
resource: The KRN identifying the asset, datastream, and data quality metric.
"""
type: KMessageTypeData
resource: KRNAssetDataStreamDataQuality