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

Copy Markdown View Source

Represents an action message sent from client to server.

Summary

Functions

Parses a raw JSON map into an Action struct.

Converts an Action struct back to a JSON-compatible map.

Types

t()

@type t() :: %A2UI.Protocol.Messages.Action{
  context: map(),
  name: String.t(),
  source_component_id: String.t(),
  surface_id: String.t(),
  timestamp: String.t()
}

Functions

from_map(map)

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

Parses a raw JSON map into an Action struct.

to_map(msg)

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

Converts an Action struct back to a JSON-compatible map.

Omits "timestamp" when nil and "context" when empty.