AtpClient.Config.Field (AtpClient v0.4.0)

Copy Markdown View Source

One configurable setting on a backend, in a shape a UI can render directly.

Backends declare their schema via AtpClient.Backend.config_schema/0. The Smart Cell (or any other UI) iterates the returned list to render a form, using :group to lay out sections and :secret? to decide masking.

Summary

Types

Layout hint for the UI

t()

Logical type of the value. The UI maps these to input widgets; the library itself does no coercion — values flow into Application.put_env/3 and the per-call opts as-is.

Types

group()

@type group() :: :connection | :defaults | :advanced

Layout hint for the UI:

  • :connection — needed to reach the backend at all (auth, endpoints). verify/1 validates these.
  • :defaults — used by high-level helpers (prove/3, query/2, …) but not required to talk to the backend.
  • :advanced — endpoint paths and other knobs most users never touch.

t()

@type t() :: %AtpClient.Config.Field{
  default: any(),
  doc: String.t() | nil,
  group: group(),
  key: atom(),
  label: String.t() | nil,
  required?: boolean(),
  secret?: boolean(),
  type: type()
}

type()

@type type() :: :string | :integer | :boolean | :string_list

Logical type of the value. The UI maps these to input widgets; the library itself does no coercion — values flow into Application.put_env/3 and the per-call opts as-is.