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

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 description of the api

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() | Spark.Dsl.t()) :: mfa() | nil

The allow MFA for an api

Link to this function

allow_unregistered?(api)

View Source
@spec allow_unregistered?(Ash.Api.t() | Spark.Dsl.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 description(Spark.Dsl.t() | Ash.Api.t()) :: String.t() | nil

The description of the api

Link to this function

find_manage_relationships_with_identity_not_configured(otp_app)

View Source
@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() | 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 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()) :: atom()

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