A2UI.Protocol.Messages.UpdateDataModel (A2UI v0.3.0)

Copy Markdown View Source

Represents an updateDataModel message from the A2UI protocol.

Summary

Functions

Parses a raw JSON map (the inner updateDataModel object) into a struct.

Converts an UpdateDataModel struct back to a JSON-compatible map (inner object).

Types

t()

@type t() :: %A2UI.Protocol.Messages.UpdateDataModel{
  has_value: boolean(),
  path: String.t(),
  surface_id: String.t(),
  value: any()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Parses a raw JSON map (the inner updateDataModel object) into a struct.

When "value" is present in the map, has_value is set to true. Omitting "value" means "delete at path" per the spec.

to_map(msg)

@spec to_map(t()) :: map()

Converts an UpdateDataModel struct back to a JSON-compatible map (inner object).

Includes "value" only when has_value is true (absence signals delete).