MishkaCmsMigration (Mishka CMS Migration v0.0.1)

Copy Markdown View Source

The migration extension's Ash domain. The extension moves a site from another CMS into a Mishka CMS site. No source ships yet: WordPress is planned as the first, and Joomla and others come later as plugins that reuse the same mapping, dry run, import job and report.

A source is a plugin behind MishkaCmsMigration.Source, each kind of item is written through an existing CMS action by a MishkaCmsMigration.Target, the jobs are the run's AshOban triggers (MishkaCmsMigration.Workers), and an import fires the events of MishkaCmsMigration.Events. Installing the extension on a site creates the permission names its runs are gated by (MishkaCmsMigration.Provision).

Usage

"wordpress" below stands for an installed source: until a source with that id is installed, create_run refuses the run (MishkaCmsMigration.Source.fetch/1).

{:ok, run} =
  MishkaCmsMigration.create_run(
    %{source: "wordpress", source_host: "example.com",
      connection: %{"url" => "https://example.com", "user" => "admin"},
      options: %{pages: "draft"}, secret: "abcd efgh ijkl"},
    actor: admin, tenant: site.id
  )

{:ok, run} = MishkaCmsMigration.start_dry_run(run, actor: admin, tenant: site.id)
{:ok, run} = MishkaCmsMigration.start_import(run, actor: admin, tenant: site.id)

Once the run is no longer running, some of its items alone, by the ids of their MishkaCmsMigration.MigrationItems:

{:ok, run} = MishkaCmsMigration.import_items(run, [item.id], actor: admin, tenant: site.id)

Summary

Functions

Brings a left out item back into the next dry run and import

Brings a left out item back into the next dry run and import

Runs authorization checks for MishkaCmsMigration.MigrationItem.bring_back

Runs authorization checks for MishkaCmsMigration.MigrationItem.bring_back, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.cancel

Runs authorization checks for MishkaCmsMigration.MigrationRun.cancel, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.create

Runs authorization checks for MishkaCmsMigration.MigrationRun.create, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.decide

Runs authorization checks for MishkaCmsMigration.MigrationItem.decide, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.dry_run_items

Runs authorization checks for MishkaCmsMigration.MigrationRun.dry_run_items, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.fail

Runs authorization checks for MishkaCmsMigration.MigrationRun.fail, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_dry_run

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_dry_run, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_import

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_import, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_items

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_items, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.forget_deleted_decision

Runs authorization checks for MishkaCmsMigration.MigrationItem.forget_deleted_decision, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.read

Runs authorization checks for MishkaCmsMigration.MigrationRun.read, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.import_items

Runs authorization checks for MishkaCmsMigration.MigrationRun.import_items, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_file_hash

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_file_hash, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_sources

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_sources, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.waiting_for_decision

Runs authorization checks for MishkaCmsMigration.MigrationItem.waiting_for_decision, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.leave_out

Runs authorization checks for MishkaCmsMigration.MigrationItem.leave_out, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.left_out_by_slugs

Runs authorization checks for MishkaCmsMigration.MigrationItem.left_out_by_slugs, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.record

Runs authorization checks for MishkaCmsMigration.MigrationItem.record, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_outcome

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_outcome, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_plan

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_plan, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationLog.record

Runs authorization checks for MishkaCmsMigration.MigrationLog.record, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.record_progress

Runs authorization checks for MishkaCmsMigration.MigrationRun.record_progress, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_dry_run

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_dry_run, returning a boolean.

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_import

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_import, returning a boolean.

Ends a run: its job is cancelled, its secret and file cleared, and it cannot run again

Ends a run: its job is cancelled, its secret and file cleared, and it cannot run again

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Returns the changeset corresponding to the action.

Creates a run on the tenant's site, started by the actor, once its source answers

Creates a run on the tenant's site, started by the actor, once its source answers

Maps the item to a record the CMS holds or back (nil), or decides its conflict

Maps the item to a record the CMS holds or back (nil), or decides its conflict

Answers one conflict with one choice on every item that waits for it, in one update

Answers one conflict with one choice on every item that waits for it, in one update

Queues a dry run of the picked items alone, which puts the run back where it was

Queues a dry run of the picked items alone, which puts the run back where it was

System-internal: saves why a dry run or an import could not go on

System-internal: saves why a dry run or an import could not go on

System-internal: saves the dry run's report

System-internal: saves the dry run's report

System-internal: saves the import's report

System-internal: saves the import's report

System-internal: saves the report a job of picked items merged and puts the run back

System-internal: saves the report a job of picked items merged and puts the run back

System-internal: forgets the decision on a deleted CMS record once the item has a record again

System-internal: forgets the decision on a deleted CMS record once the item has a record again

Queues the import of the picked items alone, which puts the run back where it was

Queues the import of the picked items alone, which puts the run back where it was

The earliest item of the site whose file has these bytes (a SHA-256), if any

The earliest item of the site whose file has these bytes (a SHA-256), if any

The items of a source host and kind with any of the given source ids

The items of a source host and kind with any of the given source ids

The items of a source host that wait for a decision no admin has made

The items of a source host that wait for a decision no admin has made

Leaves the item out of every later dry run and import, keeping its CMS record

Leaves the item out of every later dry run and import, keeping its CMS record

The items of a source host and kind an admin left out, with any of the given slugs

The items of a source host and kind an admin left out, with any of the given slugs

Maps the item to a record the CMS holds or back (nil), or decides its conflict

Maps the item to a record the CMS holds or back (nil), or decides its conflict

page(page, request) deprecated

Returns the query corresponding to the action.

Returns the query corresponding to the action.

System-internal: an item whose CMS record an import wrote

System-internal: an item whose CMS record an import wrote

System-internal: an item an import skipped or failed, keeping what was last written

System-internal: an item an import skipped or failed, keeping what was last written

System-internal: what a dry run would do with an item, keeping what imports recorded

System-internal: what a dry run would do with an item, keeping what imports recorded

System-internal: one step of a run, once it is saved

System-internal: one step of a run, once it is saved

System-internal: how far the running job is, saved after each page it walks

System-internal: how far the running job is, saved after each page it walks

Queues a dry run, a first one or Run again: what an import would create, update and skip, writing nothing

Queues a dry run, a first one or Run again: what an import would create, update and skip, writing nothing

Queues the import of a run whose dry run has reported

Queues the import of a run whose dry run has reported

Functions

aggregate(query, aggregate_or_aggregates, opts \\ [])

This function is deprecated. Use `Ash.aggregate/3` instead.

aggregate!(query, aggregate_or_aggregates, opts \\ [])

This function is deprecated. Use `Ash.aggregate!/3` instead.

avg(query, field, opts \\ [])

This function is deprecated. Use `Ash.avg/3` instead.

avg!(query, field, opts \\ [])

This function is deprecated. Use `Ash.avg!/3` instead.

bring_back_item(record, params \\ nil, opts \\ nil)

Brings a left out item back into the next dry run and import

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

bring_back_item!(record, params \\ nil, opts \\ nil)

Brings a left out item back into the next dry run and import

Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

bulk_create(inputs, resource, action, opts \\ [])

This function is deprecated. Use `Ash.bulk_create/4` instead.

bulk_create!(inputs, resource, action, opts \\ [])

This function is deprecated. Use `Ash.bulk_create!/4` instead.

bulk_destroy(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_destroy/4` instead.

bulk_destroy!(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_destroy!/4` instead.

bulk_update(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_update/4` instead.

bulk_update!(stream_or_query, action, input, opts \\ [])

This function is deprecated. Use `Ash.bulk_update!/4` instead.

calculate(resource, calculation, opts \\ [])

This function is deprecated. Use `Ash.calculate/3` instead.

calculate!(resource, calculation, opts \\ [])

This function is deprecated. Use `Ash.calculate!/3` instead.

can(action_or_query_or_changeset, actor, opts \\ [])

This function is deprecated. Use `Ash.can/3` instead.
@spec can(
  action_or_query_or_changeset ::
    Ash.Query.t()
    | Ash.Changeset.t()
    | {Ash.Resource.t(), atom() | Ash.Resource.Actions.action()},
  actor :: term(),
  opts :: Keyword.t()
) ::
  {:ok, boolean() | :maybe}
  | {:ok, true, Ash.Changeset.t() | Ash.Query.t()}
  | {:ok, true, Ash.Changeset.t(), Ash.Query.t()}
  | {:ok, false, Exception.t()}
  | {:error, term()}

can?(query_or_changeset_or_action, actor, opts \\ [])

This function is deprecated. Use `Ash.can?/3` instead.
@spec can?(
  query_or_changeset_or_action ::
    Ash.Query.t()
    | Ash.Changeset.t()
    | {Ash.Resource.t(), atom() | Ash.Resource.Actions.action()},
  actor :: term(),
  opts :: Keyword.t()
) :: boolean() | no_return()

can_bring_back_item(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.bring_back

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_bring_back_item?(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.bring_back, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_cancel_run(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.cancel

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_cancel_run?(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.cancel, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_create_run(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.create

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_create_run?(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.create, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_decide_item(actor_or_scope, record, decision, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_decide_item?(actor_or_scope, record, decision, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_decide_items(actor_or_scope, record, conflict, decision, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.decide

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_decide_items?(actor_or_scope, record, conflict, decision, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.decide, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_dry_run_items(actor_or_scope, record, items, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.dry_run_items

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_dry_run_items?(actor_or_scope, record, items, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.dry_run_items, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_fail_run(actor_or_scope, record, error, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.fail

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_fail_run?(actor_or_scope, record, error, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.fail, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_finish_dry_run(actor_or_scope, record, report, extra, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_dry_run

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_finish_dry_run?(actor_or_scope, record, report, extra, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_dry_run, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_finish_import(actor_or_scope, record, report, extra, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_import

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_finish_import?(actor_or_scope, record, report, extra, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_import, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_finish_items(actor_or_scope, record, report, status, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_items

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_finish_items?(actor_or_scope, record, report, status, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.finish_items, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_forget_item_deleted_decision(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.forget_deleted_decision

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_forget_item_deleted_decision?(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.forget_deleted_decision, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_get_run(actor_or_scope, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.read

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_get_run?(actor_or_scope, id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.read, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_import_items(actor_or_scope, record, items, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.import_items

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_import_items?(actor_or_scope, record, items, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.import_items, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_items_by_file_hash(actor_or_scope, file_hash, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_file_hash

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_items_by_file_hash?(actor_or_scope, file_hash, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_file_hash, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_items_by_sources(actor_or_scope, source_host, source_kind, source_ids, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_sources

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_items_by_sources?(actor_or_scope, source_host, source_kind, source_ids, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.by_sources, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_items_waiting_for_decision(actor_or_scope, source_host, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.waiting_for_decision

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_items_waiting_for_decision?(actor_or_scope, source_host, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.waiting_for_decision, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_leave_out_item(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.leave_out

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_leave_out_item?(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.leave_out, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_left_out_items_by_slugs(actor_or_scope, source_host, source_kind, source_slugs, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.left_out_by_slugs

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_left_out_items_by_slugs?(actor_or_scope, source_host, source_kind, source_slugs, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.left_out_by_slugs, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_map_item(actor_or_scope, record, mapped_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_map_item?(actor_or_scope, record, mapped_id, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.choose, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_item(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.record

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_item?(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.record, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_item_outcome(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_outcome

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_item_outcome?(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_outcome, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_item_plan(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_plan

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_item_plan?(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationItem.record_plan, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_log(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationLog.record

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_log?(actor_or_scope, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationLog.record, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_progress(actor_or_scope, record, progress, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.record_progress

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_record_progress?(actor_or_scope, record, progress, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.record_progress, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_start_dry_run(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_dry_run

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_start_dry_run?(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_dry_run, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_start_import(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_import

Accepts an actor or a scope as the first argument.

See Ash.can/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

can_start_import?(actor_or_scope, record, params_or_opts \\ %{}, opts \\ [])

Runs authorization checks for MishkaCmsMigration.MigrationRun.start_import, returning a boolean.

Accepts an actor or a scope as the first argument.

See Ash.can?/3 for more information

Options

  • :maybe_is (term/0) - If the actor may be able to perform the action, what value should be returned. The default value is :maybe.

  • :filter_with - If set to :error, the query will raise an error on a match. If set to :filter the query will filter out unauthorized access. Valid values are :filter, :error The default value is :filter.

  • :validate? (boolean/0) - Whether or not to treat an invalid action as a non-allowed action. The default value is false.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :pre_flight? (boolean/0) - Whether or not this is a pre_flight check (which may perform optimized in-memory checks) or the final proper check. The default value is true.

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol. Provides a default tenant and deep merges context (explicit opts take precedence). The actor is always taken from the second argument to can/3. See Ash.Scope for more.

  • :context (map/0) - Context to set on the query/changeset/action_input being authorized

  • :run_queries? (boolean/0) - Whether or not to run queries. If set to true, :maybe will not be returned. The default value is true.

  • :data - The record or records specifically attempting to be acted upon.

  • :tenant (value that implements the Ash.ToTenant protocol) - The tenant to use for authorization

  • :as_of - A point in time to authorize "as of" (time travel). See Ash.Query.as_of/2.

  • :alter_source? (boolean/0) - If set to true, the source being authorized is returned so it can be run. The default value is false.

  • :base_query (term/0) - A base query on which to apply an generated filters

  • :no_check? (boolean/0) - Whether or not authorization must pass at the strict/filter step, or if post-checks are allowed to be run The default value is false.

  • :on_must_pass_strict_check (term/0) - Override the value returned when no_check? is true but a check must be run.

  • :atomic_changeset (term/0) - A base query on which to apply an generated filters

  • :return_forbidden_error? (boolean/0) - Whether or not to return a forbidden error in cases of not being authorized. The default value is false.

  • :log? (boolean/0) - Whether or not to log the authorization result. The default value is false.

  • :log_policy_breakdown? (boolean/0) - If set to false, suppresses policy breakdown logs, overriding the global show_policy_breakdowns? configuration.

  • :short_circuit? (boolean/0) - For can_do_all/3 and can_do_all?/3, whether to stop checking after the first failing check. Defaults to false for can_do_all/3 and true for can_do_all?/3. The default value is false.

cancel_run(record, params \\ nil, opts \\ nil)

Ends a run: its job is cancelled, its secret and file cleared, and it cannot run again

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

cancel_run!(record, params \\ nil, opts \\ nil)

Ends a run: its job is cancelled, its secret and file cleared, and it cannot run again

Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

changeset_to_bring_back_item(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_cancel_run(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_create_run(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_decide_item(record, decision, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_decide_items(record, conflict, decision, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_dry_run_items(record, items, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_fail_run(record, error, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_finish_dry_run(record, report, extra, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_finish_import(record, report, extra, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_finish_items(record, report, status, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_forget_item_deleted_decision(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_import_items(record, items, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_leave_out_item(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_map_item(record, mapped_id, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_record_item(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_record_item_outcome(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_record_item_plan(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_record_log(params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :changeset (term/0) - A changeset to seed the action with.

changeset_to_record_progress(record, progress, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_start_dry_run(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

changeset_to_start_import(record, params_or_opts \\ %{}, opts \\ [])

Returns the changeset corresponding to the action.

Options

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

count(query, opts \\ [])

This function is deprecated. Use `Ash.count/2` instead.

count!(query, opts \\ [])

This function is deprecated. Use `Ash.count!/2` instead.

create(changeset, opts \\ [])

This function is deprecated. Use `Ash.create/2` instead.

create!(changeset, opts \\ [])

This function is deprecated. Use `Ash.create!/2` instead.

create_run(params \\ nil, opts \\ nil)

Creates a run on the tenant's site, started by the actor, once its source answers

Inputs

  • file - The file a source that reads one is handed: the form's staged upload
  • options - What the admin chose for this run (MishkaCmsMigration.MigrationRun.Options)
  • connection - How the source connects, without its secret: an address, a user name, a file
  • source - The id of the source plugin the run reads (MishkaCmsMigration.Source)
  • language - The one language every item of an unknown or unpublished language is put in
  • secret - The secret the source signs in with; only its sealed form is kept
  • source_host - The host the run reads from, such as example.com or localhost:8080
  • bring - The switches of what the run brings, folded into its options

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

create_run!(params \\ nil, opts \\ nil)

Creates a run on the tenant's site, started by the actor, once its source answers

Raises any errors instead of returning them

Inputs

  • file - The file a source that reads one is handed: the form's staged upload
  • options - What the admin chose for this run (MishkaCmsMigration.MigrationRun.Options)
  • connection - How the source connects, without its secret: an address, a user name, a file
  • source - The id of the source plugin the run reads (MishkaCmsMigration.Source)
  • language - The one language every item of an unknown or unpublished language is put in
  • secret - The secret the source signs in with; only its sealed form is kept
  • source_host - The host the run reads from, such as example.com or localhost:8080
  • bring - The switches of what the run brings, folded into its options

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

decide_item(record, decision, params \\ nil, opts \\ nil)

Maps the item to a record the CMS holds or back (nil), or decides its conflict

Arguments

  • decision - The answer to the conflict the item waits on: keep, import or leave_out

Inputs

  • conflict - Which of the item's open conflicts the decision answers, its first when nil
  • mapped_id - The record of the kind's CMS resource an admin mapped the item to, nil to import it as its own

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

decide_item!(record, decision, params \\ nil, opts \\ nil)

Maps the item to a record the CMS holds or back (nil), or decides its conflict

Raises any errors instead of returning them

Arguments

  • decision - The answer to the conflict the item waits on: keep, import or leave_out

Inputs

  • conflict - Which of the item's open conflicts the decision answers, its first when nil
  • mapped_id - The record of the kind's CMS resource an admin mapped the item to, nil to import it as its own

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

decide_items(record, conflict, decision, params \\ nil, opts \\ nil)

Answers one conflict with one choice on every item that waits for it, in one update

Arguments

  • conflict
  • decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

decide_items!(record, conflict, decision, params \\ nil, opts \\ nil)

Answers one conflict with one choice on every item that waits for it, in one update

Raises any errors instead of returning them

Arguments

  • conflict
  • decision

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

default_short_name()

destroy(record, opts \\ [])

This function is deprecated. Use `Ash.destroy/2` instead.

destroy!(record, opts \\ [])

This function is deprecated. Use `Ash.destroy!/2` instead.

dry_run_items(record, items, params \\ nil, opts \\ nil)

Queues a dry run of the picked items alone, which puts the run back where it was

Arguments

  • items - The ids of the picked items, items of the run's site and source host

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

dry_run_items!(record, items, params \\ nil, opts \\ nil)

Queues a dry run of the picked items alone, which puts the run back where it was

Raises any errors instead of returning them

Arguments

  • items - The ids of the picked items, items of the run's site and source host

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

exists(query, opts \\ [])

This function is deprecated. Use `Ash.exists/2` instead.

exists?(query, opts \\ [])

This function is deprecated. Use `Ash.exists?/2` instead.

fail_run(record, error, params \\ nil, opts \\ nil)

System-internal: saves why a dry run or an import could not go on

Arguments

  • error - What stopped the job: AshOban's error after the last attempt, or Oban's

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

fail_run!(record, error, params \\ nil, opts \\ nil)

System-internal: saves why a dry run or an import could not go on

Raises any errors instead of returning them

Arguments

  • error - What stopped the job: AshOban's error after the last attempt, or Oban's

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

finish_dry_run(record, report, extra, params \\ nil, opts \\ nil)

System-internal: saves the dry run's report

Arguments

  • report - What the last dry run or import did with each item (MishkaCmsMigration.Report)
  • extra - Facts about the source, such as its version and plugins (Source's extra/1)

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

finish_dry_run!(record, report, extra, params \\ nil, opts \\ nil)

System-internal: saves the dry run's report

Raises any errors instead of returning them

Arguments

  • report - What the last dry run or import did with each item (MishkaCmsMigration.Report)
  • extra - Facts about the source, such as its version and plugins (Source's extra/1)

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

finish_import(record, report, extra, params \\ nil, opts \\ nil)

System-internal: saves the import's report

Arguments

  • report - What the last dry run or import did with each item (MishkaCmsMigration.Report)
  • extra - Facts about the source, such as its version and plugins (Source's extra/1)

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

finish_import!(record, report, extra, params \\ nil, opts \\ nil)

System-internal: saves the import's report

Raises any errors instead of returning them

Arguments

  • report - What the last dry run or import did with each item (MishkaCmsMigration.Report)
  • extra - Facts about the source, such as its version and plugins (Source's extra/1)

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

finish_items(record, report, status, params \\ nil, opts \\ nil)

System-internal: saves the report a job of picked items merged and puts the run back

Arguments

  • report - What the last dry run or import did with each item (MishkaCmsMigration.Report)
  • status - The status the run was in before the job of picked items

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

finish_items!(record, report, status, params \\ nil, opts \\ nil)

System-internal: saves the report a job of picked items merged and puts the run back

Raises any errors instead of returning them

Arguments

  • report - What the last dry run or import did with each item (MishkaCmsMigration.Report)
  • status - The status the run was in before the job of picked items

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

first(query, field, opts \\ [])

This function is deprecated. Use `Ash.first/3` instead.

first!(query, field, opts \\ [])

This function is deprecated. Use `Ash.first!/3` instead.

forget_item_deleted_decision(record, params \\ nil, opts \\ nil)

System-internal: forgets the decision on a deleted CMS record once the item has a record again

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

forget_item_deleted_decision!(record, params \\ nil, opts \\ nil)

System-internal: forgets the decision on a deleted CMS record once the item has a record again

Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

get(resource, id_or_filter, opts \\ [])

This function is deprecated. Use `Ash.get/3` instead.

get!(resource, id_or_filter, opts \\ [])

This function is deprecated. Use `Ash.get!/3` instead.

get_run(id, params \\ nil, opts \\ nil)

A site's runs

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

get_run!(id, params \\ nil, opts \\ nil)

A site's runs

Raises any errors instead of returning them

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

import_items(record, items, params \\ nil, opts \\ nil)

Queues the import of the picked items alone, which puts the run back where it was

Arguments

  • items - The ids of the picked items, items of the run's site and source host

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

import_items!(record, items, params \\ nil, opts \\ nil)

Queues the import of the picked items alone, which puts the run back where it was

Raises any errors instead of returning them

Arguments

  • items - The ids of the picked items, items of the run's site and source host

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

items_by_file_hash(file_hash, params \\ nil, opts \\ nil)

The earliest item of the site whose file has these bytes (a SHA-256), if any

Arguments

  • file_hash

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

items_by_file_hash!(file_hash, params \\ nil, opts \\ nil)

The earliest item of the site whose file has these bytes (a SHA-256), if any

Raises any errors instead of returning them

Arguments

  • file_hash

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

items_by_sources(source_host, source_kind, source_ids, params \\ nil, opts \\ nil)

The items of a source host and kind with any of the given source ids

Arguments

  • source_host
  • source_kind
  • source_ids

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

items_by_sources!(source_host, source_kind, source_ids, params \\ nil, opts \\ nil)

The items of a source host and kind with any of the given source ids

Raises any errors instead of returning them

Arguments

  • source_host
  • source_kind
  • source_ids

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

items_waiting_for_decision(source_host, params \\ nil, opts \\ nil)

The items of a source host that wait for a decision no admin has made

Arguments

  • source_host

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

items_waiting_for_decision!(source_host, params \\ nil, opts \\ nil)

The items of a source host that wait for a decision no admin has made

Raises any errors instead of returning them

Arguments

  • source_host

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

leave_out_item(record, params \\ nil, opts \\ nil)

Leaves the item out of every later dry run and import, keeping its CMS record

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

leave_out_item!(record, params \\ nil, opts \\ nil)

Leaves the item out of every later dry run and import, keeping its CMS record

Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

left_out_items_by_slugs(source_host, source_kind, source_slugs, params \\ nil, opts \\ nil)

The items of a source host and kind an admin left out, with any of the given slugs

Arguments

  • source_host
  • source_kind
  • source_slugs

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

left_out_items_by_slugs!(source_host, source_kind, source_slugs, params \\ nil, opts \\ nil)

The items of a source host and kind an admin left out, with any of the given slugs

Raises any errors instead of returning them

Arguments

  • source_host
  • source_kind
  • source_slugs

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :page - Pagination options, see Ash.read/2 for more.

  • :load (term/0) - A load statement to add onto the query

  • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

  • :lock (term/0) - A lock statement to add onto the query

  • :return_query? (boolean/0) - If true, the query that was ultimately used is returned as a third tuple element.
    The query goes through many potential changes during a request, potentially adding authorization filters, or replacing relationships for other data layers with their corresponding ids. This option can be used to get the true query that was sent to the data layer. The default value is false.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

    Ash.load!(user, :full_name, reuse_values?: true) The default value is `false`.
  • :strict? (boolean/0) - If set to true, only specified attributes will be loaded when passing a list of fields to fetch on a relationship, which allows for more optimized data-fetching.
    See Ash.Query.load/2. The default value is false.

  • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. Valid values are :filter, :error The default value is :filter.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

  • :not_found_error? (boolean/0) - Whether or not to return or raise a NotFound error or to return nil when a get? action/interface is called.

  • :stream? (boolean/0) - If true, a stream of the results will be returned The default value is false.

  • :stream_options (keyword/0) - Options passed to Ash.stream!, if stream?: true is given

    • :batch_size (integer/0) - How many records to request in each query run. Defaults to the pagination limits on the resource, or 250.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

list(query, field, opts \\ [])

This function is deprecated. Use `Ash.list/3` instead.

list!(query, field, opts \\ [])

This function is deprecated. Use `Ash.list!/3` instead.

load(data, query, opts \\ [])

This function is deprecated. Use `Ash.load/3` instead.

load!(data, query, opts \\ [])

This function is deprecated. Use `Ash.load!/3` instead.

map_item(record, mapped_id, params \\ nil, opts \\ nil)

Maps the item to a record the CMS holds or back (nil), or decides its conflict

Arguments

  • mapped_id - The record of the kind's CMS resource an admin mapped the item to, nil to import it as its own

Inputs

  • conflict - Which of the item's open conflicts the decision answers, its first when nil
  • decision - The answer to the conflict the item waits on: keep, import or leave_out

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

map_item!(record, mapped_id, params \\ nil, opts \\ nil)

Maps the item to a record the CMS holds or back (nil), or decides its conflict

Raises any errors instead of returning them

Arguments

  • mapped_id - The record of the kind's CMS resource an admin mapped the item to, nil to import it as its own

Inputs

  • conflict - Which of the item's open conflicts the decision answers, its first when nil
  • decision - The answer to the conflict the item waits on: keep, import or leave_out

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

max(query, field, opts \\ [])

This function is deprecated. Use `Ash.max/3` instead.

max!(query, field, opts \\ [])

This function is deprecated. Use `Ash.max!/3` instead.

min(query, field, opts \\ [])

This function is deprecated. Use `Ash.min/3` instead.

min!(query, field, opts \\ [])

This function is deprecated. Use `Ash.min!/3` instead.

page(page, request)

This function is deprecated. Use `Ash.page/2` instead.

page!(page, request)

This function is deprecated. Use `Ash.page!/2` instead.

query_to_get_run(id, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

query_to_items_by_file_hash(file_hash, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

query_to_items_by_sources(source_host, source_kind, source_ids, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

query_to_items_waiting_for_decision(source_host, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

query_to_left_out_items_by_slugs(source_host, source_kind, source_slugs, params_or_opts \\ %{}, opts \\ [])

Returns the query corresponding to the action.

Options

  • :as_of - A point in time to read "as of" (time travel). See Ash.Query.as_of/2.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :query - A query to seed the action with.

read(query, opts \\ [])

This function is deprecated. Use `Ash.read/2` instead.

read!(query, opts \\ [])

This function is deprecated. Use `Ash.read!/2` instead.

read_one(query, opts \\ [])

This function is deprecated. Use `Ash.read_one/2` instead.

read_one!(query, opts \\ [])

This function is deprecated. Use `Ash.read_one!/2` instead.

record_item(params \\ nil, opts \\ nil)

System-internal: an item whose CMS record an import wrote

Inputs

  • extra - The source's fields the CMS has no home for, as of the last write (Source.Item's extra)
  • reason - Why the last import skipped or failed the item, or what its write left unconverted
  • title - What the source calls the item (Source.Item's title), as of the last write
  • outcome - What the last import that met the item did with it; nil before any import did
  • source_id - The item's id on the source
  • target_id - The CMS record the item was written to
  • source_host - The host the item was read from (the run's source_host)
  • source_kind - What the item is on the source, such as post or user
  • source_slug - The item's slug at the source (Source.Item's attrs slug), as of the last run that met it
  • source_modified_at - When the source last changed the item, as of the last write
  • content_hash - MishkaCmsMigration.Source.Item.hash/1 of the item, as of the last write
  • target_resource - The CMS resource the item was written to
  • target_updated_at - The CMS record's updated_at as the last write left it; any other value is an edit in the CMS
  • source_parent - The source id of the item of its kind it sits under at the source (Source.Item's parent)
  • run_id
  • file_hash - The SHA-256 of the file the import downloaded for a media item, as hex; nil for any other item

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_item!(params \\ nil, opts \\ nil)

System-internal: an item whose CMS record an import wrote

Raises any errors instead of returning them

Inputs

  • extra - The source's fields the CMS has no home for, as of the last write (Source.Item's extra)
  • reason - Why the last import skipped or failed the item, or what its write left unconverted
  • title - What the source calls the item (Source.Item's title), as of the last write
  • outcome - What the last import that met the item did with it; nil before any import did
  • source_id - The item's id on the source
  • target_id - The CMS record the item was written to
  • source_host - The host the item was read from (the run's source_host)
  • source_kind - What the item is on the source, such as post or user
  • source_slug - The item's slug at the source (Source.Item's attrs slug), as of the last run that met it
  • source_modified_at - When the source last changed the item, as of the last write
  • content_hash - MishkaCmsMigration.Source.Item.hash/1 of the item, as of the last write
  • target_resource - The CMS resource the item was written to
  • target_updated_at - The CMS record's updated_at as the last write left it; any other value is an edit in the CMS
  • source_parent - The source id of the item of its kind it sits under at the source (Source.Item's parent)
  • run_id
  • file_hash - The SHA-256 of the file the import downloaded for a media item, as hex; nil for any other item

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_item_outcome(params \\ nil, opts \\ nil)

System-internal: an item an import skipped or failed, keeping what was last written

Inputs

  • reason - Why the last import skipped or failed the item, or what its write left unconverted
  • title - What the source calls the item (Source.Item's title), as of the last write
  • outcome - What the last import that met the item did with it; nil before any import did
  • source_id - The item's id on the source
  • left_out - Whether an admin left the item out: no dry run or import writes it until brought back
  • source_host - The host the item was read from (the run's source_host)
  • source_kind - What the item is on the source, such as post or user
  • source_slug - The item's slug at the source (Source.Item's attrs slug), as of the last run that met it
  • source_parent - The source id of the item of its kind it sits under at the source (Source.Item's parent)
  • run_id

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_item_outcome!(params \\ nil, opts \\ nil)

System-internal: an item an import skipped or failed, keeping what was last written

Raises any errors instead of returning them

Inputs

  • reason - Why the last import skipped or failed the item, or what its write left unconverted
  • title - What the source calls the item (Source.Item's title), as of the last write
  • outcome - What the last import that met the item did with it; nil before any import did
  • source_id - The item's id on the source
  • left_out - Whether an admin left the item out: no dry run or import writes it until brought back
  • source_host - The host the item was read from (the run's source_host)
  • source_kind - What the item is on the source, such as post or user
  • source_slug - The item's slug at the source (Source.Item's attrs slug), as of the last run that met it
  • source_parent - The source id of the item of its kind it sits under at the source (Source.Item's parent)
  • run_id

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_item_plan(params \\ nil, opts \\ nil)

System-internal: what a dry run would do with an item, keeping what imports recorded

Inputs

  • title - What the source calls the item (Source.Item's title), as of the last write
  • plan - What the last dry run that met the item would do with it
  • source_id - The item's id on the source
  • left_out - Whether an admin left the item out: no dry run or import writes it until brought back
  • source_host - The host the item was read from (the run's source_host)
  • source_kind - What the item is on the source, such as post or user
  • plan_reason - Why the last dry run would skip or fail the item, or what it would write otherwise
  • source_slug - The item's slug at the source (Source.Item's attrs slug), as of the last run that met it
  • source_parent - The source id of the item of its kind it sits under at the source (Source.Item's parent)

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_item_plan!(params \\ nil, opts \\ nil)

System-internal: what a dry run would do with an item, keeping what imports recorded

Raises any errors instead of returning them

Inputs

  • title - What the source calls the item (Source.Item's title), as of the last write
  • plan - What the last dry run that met the item would do with it
  • source_id - The item's id on the source
  • left_out - Whether an admin left the item out: no dry run or import writes it until brought back
  • source_host - The host the item was read from (the run's source_host)
  • source_kind - What the item is on the source, such as post or user
  • plan_reason - Why the last dry run would skip or fail the item, or what it would write otherwise
  • source_slug - The item's slug at the source (Source.Item's attrs slug), as of the last run that met it
  • source_parent - The source id of the item of its kind it sits under at the source (Source.Item's parent)

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_log(params \\ nil, opts \\ nil)

System-internal: one step of a run, once it is saved

Inputs

  • reason - Why a dry run or an import failed (the run's reason)
  • step - The step of the run's life the entry tells of
  • user_id
  • counts - What a finished dry run or import counted (its report's counts)
  • source_host - The host the run reads from (the run's source_host)
  • run_id

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_log!(params \\ nil, opts \\ nil)

System-internal: one step of a run, once it is saved

Raises any errors instead of returning them

Inputs

  • reason - Why a dry run or an import failed (the run's reason)
  • step - The step of the run's life the entry tells of
  • user_id
  • counts - What a finished dry run or import counted (its report's counts)
  • source_host - The host the run reads from (the run's source_host)
  • run_id

Options

  • :upsert? (boolean/0) - If a conflict is found based on the primary key, the record is updated in the database (requires upsert support) The default value is false.

  • :return_skipped_upsert? (boolean/0) - If true, and a record was not upserted because its filter prevented the upsert, the original record (which was not upserted) will be returned. The default value is false.

  • :upsert_identity (atom/0) - The identity to use when detecting conflicts for upsert?, e.g. upsert_identity: :full_name. By default, the primary key is used. Has no effect if upsert?: true is not provided

  • :upsert_fields - The fields to upsert. If not set, the action's upsert_fields is used, and if that is not set, then any fields not being set to defaults are written.

  • :upsert_condition (term/0) - An expression to check if the record should be updated when there's a conflict.

  • :touch_update_defaults? (boolean/0) - Whether or not to apply update defaults (like updated_at timestamps) on upsert. Only relevant when upsert?: true is set. Set to false to skip touching update_default fields when an upsert results in an update. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :changeset (term/0) - A changeset to seed the action with.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_create, if a list or stream of inputs is provided.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :after_action (function of arity 2) - An after_action hook to be added to each processed changeset

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_progress(record, progress, params \\ nil, opts \\ nil)

System-internal: how far the running job is, saved after each page it walks

Arguments

  • progress - How far the running job is: the kind it walks and the counts so far

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

record_progress!(record, progress, params \\ nil, opts \\ nil)

System-internal: how far the running job is, saved after each page it walks

Raises any errors instead of returning them

Arguments

  • progress - How far the running job is: the kind it walks and the counts so far

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

reload(record, opts \\ [])

This function is deprecated. Use `Ash.reload/2` instead.

reload!(record, opts \\ [])

This function is deprecated. Use `Ash.reload!/2` instead.

run_action(input, opts \\ [])

This function is deprecated. Use `Ash.run_action/2` instead.

run_action!(input, opts \\ [])

This function is deprecated. Use `Ash.run_action/2` instead.

start_dry_run(record, params \\ nil, opts \\ nil)

Queues a dry run, a first one or Run again: what an import would create, update and skip, writing nothing

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

start_dry_run!(record, params \\ nil, opts \\ nil)

Queues a dry run, a first one or Run again: what an import would create, update and skip, writing nothing

Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

start_import(record, params \\ nil, opts \\ nil)

Queues the import of a run whose dry run has reported

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

start_import!(record, params \\ nil, opts \\ nil)

Queues the import of a run whose dry run has reported

Raises any errors instead of returning them

Options

  • :params (map/0) - Parameters to supply, ignored if the input is a changeset, only used when an identifier is given.

  • :atomic_upgrade? (boolean/0) - If true the action will be done atomically if it can (and is configured to do so), ignoring the in memory transformations and validations. You should not generally need to disable this. The default value is true.

  • :timeout (timeout/0) - A positive integer, or :infinity. If none is provided, the timeout configured on the domain is used.

  • :tracer (one or a list of module that adopts Ash.Tracer) - A tracer that implements the Ash.Tracer behaviour. See that module for more.

  • :action (term/0) - The action to use, either an Action struct or the name of the action

  • :authorize? - If an actor option is provided (even if it is nil), authorization happens automatically. If not, this flag can be used to authorize with no user.

  • :context (map/0) - Context to set on the query, changeset, or input

  • :tenant (value that implements the Ash.ToTenant protocol) - A tenant to set on the query or changeset

  • :as_of - A point in time to run the action "as of" (time travel). See Ash.Query.as_of/2.

  • :actor (term/0) - If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access

  • :scope (term/0) - A value that implements the Ash.Scope.ToOpts protocol, for passing around actor/tenant/context in a single value. See Ash.Scope.ToOpts for more.

  • :return_notifications? (boolean/0) - Use this if you're running ash actions in your own transaction and you want to manually handle sending notifications.
    If a transaction is ongoing, and this is false, notifications will be discarded, otherwise the return value is {:ok, result, notifications} (or {:ok, notifications})
    To send notifications later, use Ash.Notifier.notify(notifications). It sends any notifications that can be sent, and returns the rest. The default value is false.

  • :rollback_on_error? (boolean/0) - Whether or not to rollback the transaction on error, if the resource is in a transaction.
    If the action has transaction? false this option has no effect. If an error is returned from the data layer and the resource is in a transaction, the transaction is always rolled back, regardless. The default value is true.

  • :notification_metadata (term/0) - Metadata to be merged into the metadata field for all notifications sent from this operation. The default value is %{}.

  • :skip_unknown_inputs - A list of inputs that, if provided, will be ignored if they are not recognized by the action. Use :* to indicate all unknown keys.

  • :load (term/0) - A load statement to add onto the changeset

  • :strict? (boolean/0) - If set to true, only the fields listed for a relationship in load are loaded on it, as with the strict? option to Ash.load/3. The default value is false.

  • :bulk_options (keyword/0) - Options passed to Ash.bulk_update, if a query, list, or stream of inputs is provided.

    • :atomic_update (map/0) - A map of atomic updates to apply. See Ash.Changeset.atomic_update/3 for more.

    • :stream_batch_size (integer/0) - Batch size to use if provided a query and the query must be streamed

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records if the :stream strategy is chosen. See the Ash.stream!/2 docs for more. The default value is :keyset.

    • :authorize_query? (boolean/0) - If a query is given, determines whether or not authorization is run on that query. The default value is true.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :filter (term/0) - A filter to apply to records. This is also applied to a stream of inputs.

    • :strategy - The strategy or strategies to enable. :stream is used in all cases if the data layer does not support atomics. The default value is [:atomic].

    • :transform_changeset (function of arity 1) - A function that takes and returns a changeset, applied to each changeset after it is built but before validation. Used internally by managed relationships to set foreign keys and context.

    • :allow_stream_with - The 'worst' strategy allowed to be used to fetch records. See Ash.stream!/2 docs for more. The default value is :keyset.

    • :stream_with - The specific strategy to use to fetch records. See Ash.stream!/2 docs for more.

    • :max_concurrency (non_neg_integer/0) - The maximum number of processes allowed to be started for parallel loading of relationships and calculations. Defaults to System.schedulers_online() * 2

    • :lock (term/0) - A lock statement to add onto the query

    • :reuse_values? (boolean/0) - If true, allow calculations to use attributes and other dependencies already on the struct instead of refetching from the data layer. Default false (prefer persisted data; avoids stale structs acting as an implicit cache).

      Ash.load!(user, :full_name, reuse_values?: true)

      The default value is false.

    • :authorize_with - If set to :error, instead of applying authorization filters as a filter, any records not matching the authorization filter will cause an error to be returned. The default value is :filter.

    • :read_action (atom/0) - The action to use when building the read query.

    • :assume_casted? (boolean/0) - Whether or not to cast attributes and arguments as input. This is an optimization for cases where the input is already casted and/or not in need of casting The default value is false.

    • :select (list of atom/0) - A select statement to apply to records. Ignored if return_records? is not true.

    • :authorize_query_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_changeset_with - If set to :error, instead of filtering unauthorized changes, unauthorized changes will raise an appropriate forbidden error. Uses authorize_with if not set.

    • :authorize_with - If set to :error, instead of filtering unauthorized query results, unauthorized query results will raise an appropriate forbidden error. The default value is :filter.

    • :private_arguments (map/0) - Private argument values to set on each changeset before validations and changes are run. The default value is %{}.

    • :sorted? (boolean/0) - Whether or not to sort results by their input position, in cases where return_records?: true was provided. The default value is false.

    • :return_records? (boolean/0) - Whether or not to return all of the records that were inserted. Defaults to false to account for large inserts. The default value is false.

    • :return_errors? (boolean/0) - Whether to return all errors that occur during the operation. Defaults to the value of :bulk_actions_default_to_errors? in your config, or false if not set. Returning all errors may be expensive for large inserts. The default value is true.

    • :batch_size (pos_integer/0) - The number of records to include in each batch. Defaults to the default_limit or max_page_size of the action, or 100.

    • :return_stream? (boolean/0) - If set to true, instead of an Ash.BulkResult, a mixed stream is returned.

      Potential elements:

      {:notification, notification} - if return_notifications? is set to true {:ok, record} - if return_records? is set to true {:error, error} - an error that occurred. May be changeset or an individual error.

      The default value is false.

    • :return_nothing? (boolean/0) - Mutes warnings about returning nothing.

      Only relevant if return_stream? is set to true and all other return_*? options are set to false.

      The default value is false.

    • :stop_on_error? (boolean/0) - If true, the first encountered error will stop the action and be returned. Otherwise, errors will be skipped. The default value is true.

    • :notify? (boolean/0) - Whether or not to generate any notifications. If this is set to true then the data layer must return the results from each batch. This may be intensive for large bulk actions.

      Notifications will be automatically sent unless return_notifications? is set to true.

      The default value is false.

    • :transaction - Whether or not to wrap the entire execution in a transaction, each batch, or not at all.

      Keep in mind:

      before_transaction and after_transaction hooks attached to changesets will have to be run inside the transaction if you choose transaction: :all.

      The default value is :batch.

    • :max_concurrency (non_neg_integer/0) - If set to a value greater than 0, up to that many tasks will be started to run batches asynchronously The default value is 0.

  • :private_arguments (map/0) - Private argument values to set before validations and changes. The default value is %{}.

stream!(query, opts \\ [])

This function is deprecated. Use `Ash.stream!/2` instead.

sum(query, field, opts \\ [])

This function is deprecated. Use `Ash.sum/3` instead.

sum!(query, field, opts \\ [])

This function is deprecated. Use `Ash.sum!/3` instead.

update(changeset, opts \\ [])

This function is deprecated. Use `Ash.update/2` instead.

update!(changeset, opts \\ [])

This function is deprecated. Use `Ash.update!/2` instead.