unitelabs.cdk.sila.data_types

Packages

Attributes

  • Name
    __all__
    Type
    Value

    = [ "DataType", "String", "Integer", "Real", "Boolean", "Binary", "Date", "Time", "Timestamp", "Timezone", "Duration", "Any", "Void", "List", "Structure", "Constrained", "DataTypeDefinition", "CustomDataType", "parse" ]

    Description

Functions

  • parse(type_hint : typing.Type, feature : sila.server.Feature) -> sila.server.data_types.DataType

    Parameters

    • Name
      type_hint
      Type
      typing.Type
      Default
      Description

    • Name
      feature
      Type
      sila.server.Feature
      Default
      Description

    Response

    Type
    sila.server.data_types.DataType
    Description

Classes

  • CustomDataType

    Bases
    abc.ABC
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self) -> None

    • __init_subclass__(
        cls,
        *args,
        identifier,
        display_name,
        description,
        **kwargs
      ) -> None

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        *args
        Type
        Default
        = ()
        Description

      • Name
        identifier
        Type
        Default
        = ''
        Description

      • Name
        display_name
        Type
        Default
        = ''
        Description

      • Name
        description
        Type
        Default
        = ''
        Description

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

    Attributes

    • Name
      identifier
      Type
      str
      Value

      = ''

      Description

    • Name
      display_name
      Type
      str
      Value

      = ''

      Description

    • Name
      description
      Type
      str
      Value

      = ''

      Description

  • DataTypeDefinition

    Bases
    sila.server.data_types.DataTypeDefinition
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        fields_by_identifier : dict[str, str],
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        fields_by_identifier
        Type
        dict[str, str]
        Default
        Description

      • Name
        factory
        Type
        type[CustomDataType]
        Default
        = CustomDataType
        Description

    • __post_init__(self, data_type : sila.server.data_types.DataType) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        data_type
        Type
        sila.server.data_types.DataType
        Default
        Description

    • encode(
        self,
        field_number : int[]
      ) -> bytes

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        value
        Type
        CustomDataType[]
        Default
        Description

      • Name
        field_number
        Type
        int[]
        Default
        = None
        Description

      Response

      Type
      bytes
      Description

    • decode(self, data : bytes) -> CustomDataType

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        data
        Type
        bytes
        Default
        Description

      Response

      Type
      CustomDataType
      Description

    Attributes

    • Name
      fields_by_identifier
      Type
      dict[str, str]
      Value

      = dataclasses.field(repr=False, default_factory=dict)

      Description

    • Name
      factory
      Type
      type[CustomDataType]
      Value

      = dataclasses.field(repr=False, default=CustomDataType)

      Description

Copyright © 2024