Exosphere.Bsky.Feed.Post (Exosphere v0.3.0)

Copy Markdown View Source

Record schema app.bsky.feed.post.

Fields

  • created_at: Client-declared timestamp when this post was originally created.
  • embed: union
  • entities: DEPRECATED: replaced by app.bsky.richtext.facet.
  • facets: Annotations of text (mentions, URLs, hashtags, etc)
  • labels: Self-label values for this post. Effectively content warnings.
  • langs: Indicates human language of post primary text content.
  • reply: ref #replyRef
  • tags: Additional hashtags, in addition to any included in post text and facets.
  • text: The primary post content. May be an empty string, if there are embeds.

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. Record schemas include "$type".

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

Types

t()

@type t() :: %Exosphere.Bsky.Feed.Post{
  created_at: String.t(),
  embed:
    Exosphere.Bsky.Embed.Images.t()
    | Exosphere.Bsky.Embed.Video.t()
    | Exosphere.Bsky.Embed.Gallery.t()
    | Exosphere.Bsky.Embed.External.t()
    | Exosphere.Bsky.Embed.Record.t()
    | Exosphere.Bsky.Embed.RecordWithMedia.t()
    | map()
    | nil,
  entities: [Exosphere.Bsky.Feed.Post.Entity.t()] | nil,
  extra: term(),
  facets: [Exosphere.Bsky.Richtext.Facet.t()] | nil,
  labels: Exosphere.ATProto.Label.Defs.SelfLabels.t() | map() | nil,
  langs: [String.t()] | nil,
  reply: Exosphere.Bsky.Feed.Post.ReplyRef.t() | nil,
  tags: [String.t()] | nil,
  text: 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. Record schemas include "$type".

type_id()

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

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