Source code for monitor_schema.models.segments

"""Segment definitions."""
from typing import List

from pydantic import Field

from monitor_schema.models.commons import NoExtrasBaseModel


[docs]class SegmentTag(NoExtrasBaseModel): """A single tag key value pair for a segment.""" key: str = Field(max_length=1000) value: str = Field(max_length=1000)
[docs]class Segment(NoExtrasBaseModel): """A segment is a list of tags. We normalize these in the backend. """ tags: List[SegmentTag] = Field( description="List of tags that define the specific segment", max_items=10, )