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

Copy Markdown View Source

Represents a createSurface message from the A2UI protocol.

Summary

Functions

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

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

Types

t()

@type t() :: %A2UI.Protocol.Messages.CreateSurface{
  catalog_id: String.t() | nil,
  send_data_model: boolean(),
  surface_id: String.t(),
  theme: map()
}

Functions

from_map(map)

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

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

to_map(msg)

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

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

Omits "theme" when all values are nil and "sendDataModel" when false.