Event schema object classes that provide specialized functionality for representing time-based events and relationships between schemas.

EventSchemaObject

EventSchemaObject(base_cls: type, id_field_name: str, created_at_field_name: str)
Custom decorated event schema class. Event schemas can be used to reference other schema and to define interactions between schemas.

Parameters

base_cls
type
required
The base class for the event schema.
id_field_name
str
required
Name of the ID field.
created_at_field_name
str
required
Name of the created_at field.

Inheritance

Inheritance Chain:
  • EventSchemaObject
  • IdSchemaObject
  • SchemaObject
  • ABC

Descendants

  • EventSchema

Properties

created_at
CreatedAtField
The creation timestamp field for this event schema.

Static Methods

get_schema_field_type()

get_schema_field_type() -> types.UnionType

CreatedAtField

CreatedAtField(schema_obj: SchemaObjectT, created_at_field_name: str)
A class representing creation time. A unix timestamp field in a schema object.

Parameters

schema_obj
SchemaObjectT
required
The schema object this field belongs to.
created_at_field_name
str
required
Name of the created_at field.

Inheritance

Inheritance Chain:
  • CreatedAtField
  • SchemaField
  • ComparisonOperand
  • ABC
  • Generic

Properties

supported_comparison_operation_types
Sequence[ComparisonOperationType]
Sequence of supported comparison operation types for this field.

Methods

as_type()

as_type(value: Any) -> int

SchemaReference

SchemaReference(name: str, schema_obj: EventSchemaObject, referenced_schema: type[RST])
Schema reference used within an EventSchema to reference other schemas.

Parameters

name
str
required
Name of the schema reference.
schema_obj
EventSchemaObject
required
The event schema object this reference belongs to.
referenced_schema
type[RST]
required
The type of schema being referenced.

Inheritance

Inheritance Chain:
  • SchemaReference
  • SchemaField
  • ComparisonOperand
  • HasMultiplier
  • ABC
  • Generic

Properties

supported_comparison_operation_types
Sequence[ComparisonOperationType]
Sequence of supported comparison operation types for this field.

MultipliedSchemaReference

MultipliedSchemaReference(schema_reference: SchemaReference[RST], multiplier: float = 1.0)
Helper class that provides a standard way to create an ABC using inheritance.

Parameters

schema_reference
SchemaReference[RST]
required
The schema reference to be multiplied.
multiplier
float
default:"1.0"
The multiplier value.

Inheritance

Inheritance Chain:
  • MultipliedSchemaReference
  • HasMultiplier
  • ABC
  • Generic