EventPayload#
- pydantic model safir.metrics.EventPayload#
All event payloads should inherit from this.
- Parameters:
data (
Any)
- classmethod avro_schema(case_type=None, **kwargs)#
- classmethod avro_schema_to_python(parent=None, case_type=None)#
- classmethod deserialize(data, serialization_type='avro', create_instance=True, writer_schema=None)#
- Overloads:
cls (Type[TSelf]), data (bytes), serialization_type (serialization.SerializationType), create_instance (Literal[True]), writer_schema (Optional[Union[JsonDict, Type[‘AvroModel’]]]) → TSelf
cls (Type[TSelf]), data (bytes), serialization_type (serialization.SerializationType), create_instance (Literal[False]), writer_schema (Optional[Union[JsonDict, Type[‘AvroModel’]]]) → JsonDict
cls (Type[TSelf]), data (bytes), serialization_type (serialization.SerializationType), create_instance (bool), writer_schema (Optional[Union[JsonDict, Type[‘AvroModel’]]]) → Union[TSelf, JsonDict]
- classmethod deserialize_to_python(data, serialization_type='avro', writer_schema=None)#
- classmethod fake(**data)#
Creates a fake instance of the model.
- Attributes:
data: Dict[str, Any] represent the user values to use in the instance
- Parameters:
data (
Any)- Return type:
AvroBaseModel
- classmethod generate_schema(schema_type='avro')#
- Parameters:
schema_type (
Literal['avro','avro-json'], default:'avro')- Return type:
- classmethod get_fullname()#
Fullname is composed of two parts: a name and a namespace separated by a dot. A namespace is a dot-separated sequence of such names. The empty string may also be used as a namespace to indicate the null namespace. Equality of names (including field names and enum symbols) as well as fullnames is case-sensitive.
- Return type:
- classmethod validate_structure()#
Do runtime validation of fields.
Make sure all of the fields are compatible with the backing datastore (InfluxDB at the moment).
- Return type:
- asdict()#
Returns this model in dictionary form. This method differs from pydantic’s dict by converting all values to their Avro representation. It also doesn’t provide the exclude, include, by_alias, etc. parameters that dict provides.
- serialize(serialization_type='avro')#
Overrides the base AvroModel’s serialize method to inject this class’s standardization factory method