#Architecture values

    Architecture values retain authored identities and explicit connections. Constructors copy collections. Parent ownership, ports, independent arrowheads, parallel connection identities and ordered alignments remain separate values.

    ///|
    test "architecture constructors" {
    let services = [
    @architecture.Service::new("api"),
    @architecture.Service::new("db"),
    ]
    let edge = @architecture.Connection::new(
    "request",
    @architecture.Endpoint::new("api", Right),
    @architecture.Endpoint::new("db", Left),
    target_head=true,
    )
    let architecture = @architecture.Architecture::new("example", services[:], [
    edge,
    ])
    assert_eq(@architecture.validate(architecture).length(), 0)
    }

    validate has explicit node, connection, depth and work limits. It reports missing/duplicate identities, invalid parents, ownership cycles, invalid endpoints, unowned group attachments and invalid alignment members. Validation does not invent nodes or repair ownership. No syntax, renderer or host API is required to construct or validate a model.

    Alignment

    pub struct Alignment {
    axis : Axis
    members : ReadOnlyArray[String]
    } derive(Eq,
    Debug
    )

    Alignment::equal

    fn Alignment::equal(Alignment, Alignment) -> Bool
    automatically derived

    Alignment::new

    fn Alignment::new(axis : Axis, members : ArrayView[String]) -> Alignment

    Alignment::not_equal

    fn Alignment::not_equal(x : Alignment, y : Alignment) -> Bool
    automatically derived

    Alignment::to_repr

    automatically derived

    Architecture

    pub struct Architecture {
    id : String
    groups : ReadOnlyArray[Group]
    services : ReadOnlyArray[Service]
    junctions : ReadOnlyArray[Junction]
    connections : ReadOnlyArray[Connection]
    alignments : ReadOnlyArray[Alignment]
    title : String?
    accessibility_title : String?
    accessibility_description : String?
    } derive(Eq,
    Debug
    )

    Architecture::equal

    automatically derived

    Architecture::new

    fn Architecture::new(id : String, services : ArrayView[Service], connections : ArrayView[Connection], groups? : ArrayView[Group], junctions? : ArrayView[Junction], alignments? : ArrayView[Alignment], title? : String, accessibility_title? : String, accessibility_description? : String) -> Architecture

    Architecture::not_equal

    fn Architecture::not_equal(x : Architecture, y : Architecture) -> Bool
    automatically derived

    Architecture::to_repr

    automatically derived

    Architecture::with_connections

    fn Architecture::with_connections(self : Architecture, connections : ArrayView[Connection]) -> Architecture

    A copy with connections replaced.

    Architecture::with_groups

    fn Architecture::with_groups(self : Architecture, groups : ArrayView[Group]) -> Architecture

    A copy with groups replaced.

    Architecture::with_services

    fn Architecture::with_services(self : Architecture, services : ArrayView[Service]) -> Architecture

    A copy with services replaced.

    Axis

    pub(all) enum Axis {
    Row
    Column
    } derive(Eq,
    Debug
    )

    Axis::equal

    fn Axis::equal(Axis, Axis) -> Bool
    automatically derived

    Axis::not_equal

    fn Axis::not_equal(x : Axis, y : Axis) -> Bool
    automatically derived

    Axis::to_repr

    automatically derived

    Connection

    pub struct Connection {
    id : String
    source : Endpoint
    target : Endpoint
    label : String?
    source_head : Bool
    target_head : Bool
    } derive(Eq,
    Debug
    )

    Connection::equal

    fn Connection::equal(Connection, Connection) -> Bool
    automatically derived

    Connection::new

    fn Connection::new(id : String, source : Endpoint, target : Endpoint, label? : String, source_head? : Bool, target_head? : Bool) -> Connection

    Connection::not_equal

    fn Connection::not_equal(x : Connection, y : Connection) -> Bool
    automatically derived

    Connection::to_repr

    automatically derived

    Connection::with_label

    fn Connection::with_label(self : Connection, label : String?) -> Connection

    A copy with label replaced.

    Endpoint

    pub struct Endpoint {
    id : String
    side : Side
    group : Bool
    } derive(Eq,
    Debug
    )

    Endpoint::equal

    fn Endpoint::equal(Endpoint, Endpoint) -> Bool
    automatically derived

    Endpoint::new

    fn Endpoint::new(id : String, side : Side, group? : Bool) -> Endpoint

    Endpoint::not_equal

    fn Endpoint::not_equal(x : Endpoint, y : Endpoint) -> Bool
    automatically derived

    Endpoint::to_repr

    automatically derived

    Group

    pub struct Group {
    id : String
    label : String
    parent : String?
    icon :
    Reference
    ?
    } derive(Eq,
    Debug
    )

    Group::equal

    fn Group::equal(Group, Group) -> Bool
    automatically derived

    Group::new

    fn Group::new(id : String, label? : String, parent? : String, icon? :
    Reference
    ) -> Group

    Group::not_equal

    fn Group::not_equal(x : Group, y : Group) -> Bool
    automatically derived

    Group::to_repr

    automatically derived

    Group::with_label

    fn Group::with_label(self : Group, label : String) -> Group

    A copy with label replaced.

    Junction

    pub struct Junction {
    id : String
    parent : String?
    } derive(Eq,
    Debug
    )

    Junction::equal

    fn Junction::equal(Junction, Junction) -> Bool
    automatically derived

    Junction::new

    fn Junction::new(id : String, parent? : String) -> Junction

    Junction::not_equal

    fn Junction::not_equal(x : Junction, y : Junction) -> Bool
    automatically derived

    Junction::to_repr

    automatically derived

    Service

    pub struct Service {
    id : String
    label : String
    parent : String?
    icon :
    Reference
    ?
    icon_text : String?
    } derive(Eq,
    Debug
    )

    Service::equal

    fn Service::equal(Service, Service) -> Bool
    automatically derived

    Service::new

    fn Service::new(id : String, label? : String, parent? : String, icon? :
    Reference
    , icon_text? : String) -> Service

    Service::not_equal

    fn Service::not_equal(x : Service, y : Service) -> Bool
    automatically derived

    Service::to_repr

    automatically derived

    Service::with_label

    fn Service::with_label(self : Service, label : String) -> Service

    A copy with label replaced.

    Side

    pub(all) enum Side {
    Left
    Right
    Top
    Bottom
    } derive(Eq,
    Debug
    )

    Side::equal

    fn Side::equal(Side, Side) -> Bool
    automatically derived

    Side::not_equal

    fn Side::not_equal(x : Side, y : Side) -> Bool
    automatically derived

    Side::to_repr

    automatically derived

    Side::to_string

    fn Side::to_string(self : Side) -> String

    validate

    fn validate(model : Architecture, nodes_limit? : Int, edges_limit? : Int, depth_limit? : Int, work_limit? : Int) -> ReadOnlyArray[
    Diagnostic
    ]