Exosphere.ATProto.Label.Defs.LabelValueDefinition (Exosphere v0.6.0)

Copy Markdown View Source

Declares a label value and its expected interpretations and behaviors.

Object schema com.atproto.label.defs##labelValueDefinition.

Fields

  • adult_only: Does the user need to have adult content enabled in order to configure this label?
  • blurs: What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.
  • default_setting: The default setting for this label.
  • identifier: The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).
  • locales: array
  • severity: How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.

Summary

Functions

Decode a wire-format map. Delegates to new/1.

Build and validate from a map of attrs (atom or wire string keys).

Build and validate, raising ArgumentError on error.

Encode to the wire-format map.

The lexicon type ID (nsid or nsid#def) this module was generated from.

Types

t()

@type t() :: %Exosphere.ATProto.Label.Defs.LabelValueDefinition{
  adult_only: boolean() | nil,
  blurs: String.t(),
  default_setting: String.t() | nil,
  extra: term(),
  identifier: String.t(),
  locales: [Exosphere.ATProto.Label.Defs.LabelValueDefinitionStrings.t()],
  severity: String.t()
}

Functions

from_map(map)

@spec from_map(map()) ::
  {:ok, t()} | {:error, [{path :: String.t(), message :: String.t()}]}

Decode a wire-format map. Delegates to new/1.

new(attrs)

@spec new(map()) ::
  {:ok, t()} | {:error, [{path :: String.t(), message :: String.t()}]}

Build and validate from a map of attrs (atom or wire string keys).

Unknown keys are kept in extra and re-emitted by to_map/1.

new!(attrs)

@spec new!(map()) :: t()

Build and validate, raising ArgumentError on error.

to_map(struct)

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

Encode to the wire-format map.

type_id()

@spec type_id() :: String.t()

The lexicon type ID (nsid or nsid#def) this module was generated from.