View Source Ash.Resource.ManualCreate behaviour (ash v2.19.3)

A module to implement manual create actions.

Summary

Types

@type context() :: %{
  optional(:actor) => term(),
  optional(:tenant) => term(),
  optional(:tracer) => term(),
  optional(:authorize?) => boolean(),
  optional(:api) => module(),
  optional(any()) => any()
}

Callbacks

Link to this callback

bulk_create(changesets, opts, context)

View Source (optional)
@callback bulk_create(
  changesets :: Enumerable.t(Ash.Changeset.t()),
  opts :: Keyword.t(),
  context :: context()
) :: [
  ok: Ash.Resource.record(),
  error: Ash.Error.t(),
  notifications: [Ash.Notifier.Notification.t()]
]
Link to this callback

create(changeset, opts, context)

View Source
@callback create(
  changeset :: Ash.Changeset.t(),
  opts :: Keyword.t(),
  context :: context()
) ::
  {:ok, Ash.Resource.record()}
  | {:ok, Ash.Resource.record(),
     %{notifications: [Ash.Notifier.Notification.t()]}}
  | {:error, term()}