Exosphere.Community.App.Defs.Image (Exosphere v0.4.0)

Copy Markdown View Source

An image associated with an app, including accessibility and display metadata. Exactly one of image (ATProto blob) or uri (remote URL) MUST be present. Consumers SHOULD ignore image items that have neither or both.

Object schema community.lexicon.app.defs##image.

Fields

  • alt: Alt text description of the image, for accessibility.
  • aspect_ratio: ref #aspectRatio
  • image: The raw image file.
  • purpose: How directories and stores should use the image. Omit this field when no known purpose fits.
  • uri: Remote image URI.

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.Community.App.Defs.Image{
  alt: String.t(),
  aspect_ratio: Exosphere.Community.App.Defs.AspectRatio.t() | nil,
  extra: term(),
  image: term() | nil,
  purpose: String.t() | nil,
  uri: String.t() | nil
}

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.