NLdoc.Spec.Event.Error (NLdoc.Spec.Event v1.0.15)

View Source

This module defines the Ecto schema for the NLdoc Event 'error'.

Summary

Functions

This function creates a new NLdoc.Spec.Event.Error struct from a map of keys and values, where the keys are snake_case. Returns a tuple with either {:ok, error} or {:error, changeset}.

Types

t()

@type t() :: %NLdoc.Spec.Event.Error{
  context: PolymorphicEmbed.t(),
  timestamp: DateTime.t(),
  trace_id: String.t(),
  type: String.t()
}

Functions

changeset(object, attrs)

@spec changeset(
  struct(),
  map()
) :: Ecto.Changeset.t()

new(template)

@spec new(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

This function creates a new NLdoc.Spec.Event.Error struct from a map of keys and values, where the keys are snake_case. Returns a tuple with either {:ok, error} or {:error, changeset}.

Note: If you want to use a map with camelCase keys, use NLdoc.Util.Recase.to_snake/1 to convert them to snake_case before passing them to the constructor.

resource_type()