Source code for kappa_sdk.data_type
from .measure_enum import MeasureEnum
from typing import Union, Optional
from ._private._well_dto import ChannelAspectDto
[docs]
class DataType:
""" Data Type object.
Presents a KAPPA Automate Data Type object.
"""
def __init__(self, alias: str, name: str, measure: Union[MeasureEnum, str], comment: str = " ", is_built_in: bool = False, plot_channel_aspect_dto: Optional[ChannelAspectDto] = None):
self.__alias: str = alias
self.__name: str = name
self.__comment: str = comment
self.__measure: Union[MeasureEnum, str] = measure
self.__is_built_in: bool = is_built_in
self.__channel_aspect_dto: Optional[ChannelAspectDto] = plot_channel_aspect_dto
@property
def alias(self) -> str:
"""
Gets the alias of the :class:`DataType` object.
"""
return self.__alias
@property
def name(self) -> str:
"""
Gets the name of the :class:`DataType` object.
"""
return self.__name
@property
def comment(self) -> str:
"""
Gets the comment of the :class:`DataType` object.
"""
return self.__comment
@property
def measure(self) -> Union[MeasureEnum, str]:
"""
Gets the measure of the :class:`DataType` object.
"""
return self.__measure
@property
def is_built_in(self) -> bool:
"""
if the :class:`DataType` object is a built-in data type.
"""
return self.__is_built_in
@property
def channel_aspect_dto(self) -> Optional[ChannelAspectDto]:
"""
Returns the channel Aspect Dto of the data
Returns
-------
ChannelAspectDto:
dto of the channel aspect
"""
return self.__channel_aspect_dto