View Source Ash.Resource.Change behaviour (ash v2.9.24)
The behaviour for an action-specific resource change.
init/1
is defined automatically by use Ash.Resource.Change
, but can be implemented if you want to validate/transform any
options passed to the module.
The main function is change/3
. It takes the changeset, any options that were provided
when this change was configured on a resource, and the context, which currently only has
the actor.
Link to this section Summary
Link to this section Types
Link to this section Callbacks
@callback after_batch( [{Ash.Changeset.t(), Ash.Resource.record()}], Keyword.t(), context() ) :: Enumerable.t( {:ok, Ash.Resource.record()} | {:error, Ash.Error.t()} | Ash.Notifier.Notification.t() )
@callback batch_change([Ash.Changeset.t()], Keyword.t(), context()) :: Enumerable.t(Ash.Changeset.t() | Ash.Notifier.Notification.t())
@callback before_batch([Ash.Changeset.t()], Keyword.t(), context()) :: Enumerable.t(Ash.Changeset.t() | Ash.Notifier.Notification.t())
@callback change(Ash.Changeset.t(), Keyword.t(), context()) :: Ash.Changeset.t()