Skip to content

model

mlte/value/model.py

Model implementation for MLTE value types.

ArrayValueModel

Bases: BaseModel

The model implementation for MLTE array values.

Source code in mlte/value/model.py
100
101
102
103
104
105
106
107
class ArrayValueModel(BaseModel):
    """The model implementation for MLTE array values."""

    value_type: Literal[ValueType.ARRAY] = ValueType.ARRAY
    """An identitifier for the value type."""

    data: List[Any]
    """The array to capture."""

data instance-attribute

The array to capture.

value_type = ValueType.ARRAY class-attribute instance-attribute

An identitifier for the value type.

ImageValueModel

Bases: BaseModel

The model implementation for MLTE image values.

Source code in mlte/value/model.py
90
91
92
93
94
95
96
97
class ImageValueModel(BaseModel):
    """The model implementation for MLTE image values."""

    value_type: Literal[ValueType.IMAGE] = ValueType.IMAGE
    """An identitifier for the value type."""

    data: str
    """The image data as base64-encoded string."""

data instance-attribute

The image data as base64-encoded string.

value_type = ValueType.IMAGE class-attribute instance-attribute

An identitifier for the value type.

IntegerValueModel

Bases: BaseModel

The model implementation for MLTE integer values.

Source code in mlte/value/model.py
60
61
62
63
64
65
66
67
class IntegerValueModel(BaseModel):
    """The model implementation for MLTE integer values."""

    value_type: Literal[ValueType.INTEGER] = ValueType.INTEGER
    """An identitifier for the value type."""

    integer: int
    """The encapsulated value."""

integer instance-attribute

The encapsulated value.

value_type = ValueType.INTEGER class-attribute instance-attribute

An identitifier for the value type.

OpaqueValueModel

Bases: BaseModel

The model implementation for MLTE opaque values.

Source code in mlte/value/model.py
80
81
82
83
84
85
86
87
class OpaqueValueModel(BaseModel):
    """The model implementation for MLTE opaque values."""

    value_type: Literal[ValueType.OPAQUE] = ValueType.OPAQUE
    """An identitifier for the value type."""

    data: Dict[str, Any]
    """Encapsulated, opaque data."""

data instance-attribute

Encapsulated, opaque data.

value_type = ValueType.OPAQUE class-attribute instance-attribute

An identitifier for the value type.

RealValueModel

Bases: BaseModel

The model implementation for MLTE real values.

Source code in mlte/value/model.py
70
71
72
73
74
75
76
77
class RealValueModel(BaseModel):
    """The model implementation for MLTE real values."""

    value_type: Literal[ValueType.REAL] = ValueType.REAL
    """An identitifier for the value type."""

    real: float
    """The encapsulated value."""

real instance-attribute

The encapsulated value.

value_type = ValueType.REAL class-attribute instance-attribute

An identitifier for the value type.

ValueModel

Bases: BaseModel

The model implementation for MLTE values.

Source code in mlte/value/model.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class ValueModel(BaseModel):
    """The model implementation for MLTE values."""

    artifact_type: Literal[ArtifactType.VALUE] = ArtifactType.VALUE
    """Union discriminator."""

    metadata: EvidenceMetadata
    """Evidence metadata associated with the value."""

    value_class: str
    """Full path to class that implements this value."""

    value: Union[
        "IntegerValueModel",
        "RealValueModel",
        "OpaqueValueModel",
        "ImageValueModel",
        "ArrayValueModel",
    ] = Field(..., discriminator="value_type")
    """The body of the value."""

artifact_type = ArtifactType.VALUE class-attribute instance-attribute

Union discriminator.

metadata instance-attribute

Evidence metadata associated with the value.

value = Field(..., discriminator='value_type') class-attribute instance-attribute

The body of the value.

value_class instance-attribute

Full path to class that implements this value.

ValueType

Bases: StrEnum

An enumeration over supported value types.

Source code in mlte/value/model.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class ValueType(StrEnum):
    """An enumeration over supported value types."""

    INTEGER = "integer"
    """An integral type."""

    REAL = "real"
    """A real type."""

    OPAQUE = "opaque"
    """An opaque type."""

    IMAGE = "image"
    """An image media type."""

    ARRAY = "array"
    """An array of values."""

ARRAY = 'array' class-attribute instance-attribute

An array of values.

IMAGE = 'image' class-attribute instance-attribute

An image media type.

INTEGER = 'integer' class-attribute instance-attribute

An integral type.

OPAQUE = 'opaque' class-attribute instance-attribute

An opaque type.

REAL = 'real' class-attribute instance-attribute

A real type.