View Source Ash.Api.Info (ash v2.4.21)

Introspection tools for Ash.Api

Link to this section Summary

Functions

The allow MFA for an api

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

When authorization should happen for a given api

Gets the resources of an Api module. Can be used at compile time.

The resource registry for an api

Whether or not the actor is always required for an api

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

Gets the resources of an Api module. DO NOT USE AT COMPILE TIME.

The short name for an api

The span_name for an api and resource combination

Names a telemetry event for a given api/resource combo

The execution timeout for an api

The trace name for an api

Link to this section Functions

@spec allow(Ash.Api.t()) :: mfa() | nil

The allow MFA for an api

Link to this function

allow_unregistered?(api)

View Source
@spec allow_unregistered?(Ash.Api.t()) :: atom() | nil

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

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

When authorization should happen for a given api

Link to this macro

depend_on_resources(api)

View Source (macro)
@spec depend_on_resources(Macro.t()) :: Macro.t()

Gets the resources of an Api module. Can be used at compile time.

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

@spec registry(Ash.Api.t()) :: atom() | nil

The resource registry for an api

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

Whether or not the actor is always required for an api

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

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

@spec resources(Ash.Api.t()) :: [Ash.Resource.t()]

Gets the resources of an Api module. DO NOT USE AT COMPILE TIME.

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

@spec short_name(Ash.Api.t()) :: nil | :infinity | integer()

The short name for an api

Link to this function

span_name(api, resource, action)

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

The span_name for an api and resource combination

Link to this function

telemetry_event_name(api, name)

View Source
@spec telemetry_event_name(Ash.Api.t(), atom() | [atom()]) :: [atom()]

Names a telemetry event for a given api/resource combo

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

The execution timeout for an api

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

The trace name for an api