Source code for src.v0.models.edge

from pydantic import AliasChoices, Field, constr

from ... import DOTModel
from .meta import EdgeMetaDataResponse


[docs] class EdgeCreate(DOTModel): ( """Edge data model. They are directed edge and """ """have thus a tail and a head vertex.""" ) id: str """identifier of the edge (same as uuid, generated by Gremlin)""" outV: str """UUID of tail vertex""" inV: str """UUID of head vertex""" label: str = "" ( """Label of the edge. Can be 'contains', 'influences', 'has_value_metric, """ """or 'merged_into'. 'contains' means a project contains a vertex, """ """'influences' means a vertex influences another vertex (e.g. an uncertainty""" """influences a decision), 'has_value_metric' means an objective may have a """ """Value Metric issue, and 'merged_into' means two issues may be merged into """ """a merged issue.""" ) model_config = { "json_schema_extra": { "examples": [ { "id": "22222222-bbbb-eeee-aaaa-333333333333", "outV": "44444444-0000-1111-ffff-cccccccccccc", "inV": "11111111-aaaa-2222-bbbb-888888888888", "label": "contains", } ] } }
# class EdgeUpdate(DOTModel): # outV: str | None = None # inV: str | None = None # label: str | None = None # model_config = { # "json_schema_extra": { # "examples": [ # { # "outV": "44444444-0000-1111-ffff-cccccccccccc", # "inV": "11111111-aaaa-2222-bbbb-888888888888", # "label": "contains", # } # ] # } # }
[docs] class EdgeResponse(EdgeMetaDataResponse): outV: str inV: str id: str = Field(validation_alias=AliasChoices("T.id", "id")) label: constr(to_lower=True) = Field( validation_alias=AliasChoices("T.label", "label") ) model_config = { "json_schema_extra": { "examples": [ { "uuid": "22222222-bbbb-eeee-aaaa-333333333333", "id": "22222222-bbbb-eeee-aaaa-333333333333", "outV": "44444444-0000-1111-ffff-cccccccccccc", "inV": "11111111-aaaa-2222-bbbb-888888888888", "label": "contains", } ] } }