View Source Ash.Domain.Info (ash v3.4.46)

Introspection tools for Ash.Domain

Summary

Functions

The allow MFA for a domain

Whether or not the domain allows unregistered resources to be used with it

When authorization should happen for a given domain

Gets the resources of a domain module. Can be used at compile time.

The description of the domain

Determine what domain to use when interacting with a related resource.

Whether or not the actor is always required for a domain

Returns {:ok, resource} if the resource can be used by the domain, or {:error, error}.

Gets the resource references of a domain module. DO NOT USE AT COMPILE TIME.

Gets the resources of a domain module.

The short name for a domain

The span_name for a domain and resource combination

Names a telemetry event for a given domain/resource combo

The execution timeout for a domain

The trace name for a domain

Functions

allow(domain)

@spec allow(Ash.Domain.t() | Spark.Dsl.t()) :: mfa() | nil

The allow MFA for a domain

allow_unregistered?(domain)

@spec allow_unregistered?(Ash.Domain.t() | Spark.Dsl.t()) :: atom() | nil

Whether or not the domain allows unregistered resources to be used with it

authorize(domain)

@spec authorize(Ash.Domain.t()) :: :always | :by_default | :when_requested

When authorization should happen for a given domain

depend_on_resources(domain)

(macro)
This macro is deprecated. Use `Ash.Domain.Info.resources/1` instead. This macro is no longer necessary.
@spec depend_on_resources(Macro.t()) :: Macro.t()

Gets the resources of a domain module. Can be used at compile time.

Liberal use of this can greatly increase compile times, or even cause compiler deadlocks. Use with care.

description(domain)

@spec description(Spark.Dsl.t() | Ash.Domain.t()) :: String.t() | nil

The description of the domain

find_manage_relationships_with_identity_not_configured(otp_app)

require_actor?(domain)

@spec require_actor?(Ash.Domain.t()) :: boolean()

Whether or not the actor is always required for a domain

resource(domain, resource)

@spec resource(Ash.Domain.t() | Spark.Dsl.t(), Ash.Resource.t()) ::
  {:ok, Ash.Resource.t()} | {:error, Ash.Error.t()}

Returns {:ok, resource} if the resource can be used by the domain, or {:error, error}.

resource_references(domain)

@spec resource_references(Spark.Dsl.t() | Ash.Domain.t()) :: [
  Ash.Domain.Dsl.ResourceReference.t()
]

Gets the resource references of a domain module. DO NOT USE AT COMPILE TIME.

If you need the resource list at compile time, use depend_on_resources/1

resources(domain)

@spec resources(Spark.Dsl.t() | Ash.Domain.t()) :: [Ash.Resource.t()]

Gets the resources of a domain module.

short_name(domain)

@spec short_name(Ash.Domain.t()) :: atom()

The short name for a domain

span_name(domain, resource, action)

@spec span_name(Ash.Domain.t(), Ash.Resource.t(), action :: atom() | binary()) ::
  String.t()

The span_name for a domain and resource combination

telemetry_event_name(domain, name)

@spec telemetry_event_name(Ash.Domain.t(), atom() | [atom()]) :: [atom()]

Names a telemetry event for a given domain/resource combo

timeout(domain)

@spec timeout(Ash.Domain.t()) :: nil | :infinity | integer()

The execution timeout for a domain

trace_name(domain)

@spec trace_name(Ash.Domain.t()) :: String.t()

The trace name for a domain