TypeSafeSDK.Question.Choice (TypeSafeSDK v0.4.1)

Copy Markdown View Source

Strict Choice with 2..255 alternatives and finite caller-key restoration.

Pair lists preserve order. Maps are sorted by wire key, not assumed to retain insertion order. :extra permits future fields except type/instructions/criteria.

Summary

Types

t()

@type t() :: %TypeSafeSDK.Question.Choice{
  criteria: list(),
  extra: map(),
  instructions: term()
}

Functions

new(instructions, criteria, opts \\ [])

@spec new(term(), map() | list(), keyword()) ::
  {:ok, t()} | {:error, TypeSafeSDK.Error.t()}

new!(instructions, criteria, opts \\ [])

@spec new!(term(), map() | list(), keyword()) :: t()