Ash.Resource.Info (ash v1.46.8) View Source

Introspection for resources

Link to this section Summary

Functions

Returns the action with the matching name and type on the resource

Returns all actions of a resource

Get an aggregate by name

Returns all aggregates of a resource

Get an attribute name from the resource

Returns all attributes of a resource

A list of authorizers to be used when accessing

Get a calculation by name

Returns all calculations of a resource

Returns the configured default actions

A list of identities for the resource

Get the multitenancy strategy for a resource

A list of notifiers to be used when accessing

Returns the primary action of a given type

Returns the primary action of the given type

A list of field names corresponding to the primary key

Get an aggregate by name

Returns all public aggregates of a resource

Get a public attribute name from the resource

Returns all public attributes of a resource

Get a public calculation by name

Returns all public calculations of a resource

Get a public relationship by name or path

Returns all public relationships of a resource

Get a relationship by name or path

Returns all relationships of a resource

Whether or not a given module is a resource module

A list of all validations for the resource

Link to this section Functions

Link to this function

action(resource, name, type \\ nil)

View Source

Specs

Returns the action with the matching name and type on the resource

Specs

Returns all actions of a resource

Link to this function

aggregate(resource, name)

View Source

Specs

aggregate(Ash.Resource.t(), atom() | String.t()) ::
  Ash.Resource.Aggregate.t() | nil

Get an aggregate by name

Specs

Returns all aggregates of a resource

Link to this function

attribute(resource, name)

View Source

Specs

attribute(Ash.Resource.t(), String.t() | atom()) ::
  Ash.Resource.Attribute.t() | nil

Get an attribute name from the resource

Specs

Returns all attributes of a resource

Specs

authorizers(Ash.Resource.t()) :: [module()]

A list of authorizers to be used when accessing

Specs

base_filter(Ash.Resource.t()) :: term()
Link to this function

calculation(resource, name)

View Source

Specs

calculation(Ash.Resource.t(), atom() | String.t()) ::
  Ash.Resource.Calculation.t() | nil

Get a calculation by name

Specs

Returns all calculations of a resource

Link to this function

default_actions(resource)

View Source

Specs

default_actions(Ash.Resource.t()) :: [:create | :read | :update | :destroy]

Returns the configured default actions

Link to this function

default_context(resource)

View Source

Specs

default_context(Ash.Resource.t()) :: term()

Specs

description(Ash.Resource.t()) :: String.t() | nil

Specs

embedded?(Ash.Resource.t()) :: boolean()

Specs

extensions(Ash.Resource.t()) :: [module()]
Link to this function

get_metadata(record, key_or_path)

View Source

Specs

get_metadata(Ash.Resource.record(), atom() | [atom()]) :: term()

Specs

A list of identities for the resource

Specs

Link to this function

multitenancy_attribute(resource)

View Source

Specs

multitenancy_attribute(Ash.Resource.t()) :: atom() | nil
Link to this function

multitenancy_global?(resource)

View Source

Specs

multitenancy_global?(Ash.Resource.t()) :: atom() | nil
Link to this function

multitenancy_parse_attribute(resource)

View Source

Specs

multitenancy_parse_attribute(Ash.Resource.t()) :: {atom(), atom(), [any()]}
Link to this function

multitenancy_source(resource)

View Source

Specs

multitenancy_source(Ash.Resource.t()) :: atom() | nil
Link to this function

multitenancy_strategy(resource)

View Source

Specs

multitenancy_strategy(Ash.Resource.t()) :: :context | :attribute | nil

Get the multitenancy strategy for a resource

Link to this function

multitenancy_template(resource)

View Source

Specs

multitenancy_template(Ash.Resource.t()) :: atom() | nil

Specs

notifiers(Ash.Resource.t()) :: [module()]

A list of notifiers to be used when accessing

Link to this function

primary_action(resource, type)

View Source

Specs

Returns the primary action of a given type

Link to this function

primary_action!(resource, type)

View Source

Specs

Returns the primary action of the given type

Specs

primary_key(Ash.Resource.t()) :: [atom()]

A list of field names corresponding to the primary key

Link to this function

public_aggregate(resource, name)

View Source

Specs

public_aggregate(Ash.Resource.t(), atom() | String.t()) ::
  Ash.Resource.Aggregate.t() | nil

Get an aggregate by name

Link to this function

public_aggregates(resource)

View Source

Specs

public_aggregates(Ash.Resource.t()) :: [Ash.Resource.Aggregate.t()]

Returns all public aggregates of a resource

Link to this function

public_attribute(resource, name)

View Source

Specs

public_attribute(Ash.Resource.t(), String.t() | atom()) ::
  Ash.Resource.Attribute.t() | nil

Get a public attribute name from the resource

Link to this function

public_attributes(resource)

View Source

Specs

public_attributes(Ash.Resource.t()) :: [Ash.Resource.Attribute.t()]

Returns all public attributes of a resource

Link to this function

public_calculation(resource, name)

View Source

Specs

public_calculation(Ash.Resource.t(), atom() | String.t()) ::
  Ash.Resource.Calculation.t() | nil

Get a public calculation by name

Link to this function

public_calculations(resource)

View Source

Specs

public_calculations(Ash.Resource.t()) :: [Ash.Resource.Calculation.t()]

Returns all public calculations of a resource

Link to this function

public_relationship(resource, relationship_name)

View Source

Get a public relationship by name or path

Link to this function

public_relationships(resource)

View Source

Specs

public_relationships(Ash.Resource.t()) :: [
  Ash.Resource.Relationships.relationship()
]

Returns all public relationships of a resource

Link to this function

put_metadata(record, key, term)

View Source

Specs

put_metadata(Ash.Resource.record(), atom(), term()) :: Ash.Resource.record()
Link to this function

related(resource, relationship)

View Source

Specs

related(Ash.Resource.t(), atom() | String.t() | [atom() | String.t()]) ::
  Ash.Resource.t() | nil
Link to this function

relationship(resource, relationship_name)

View Source

Specs

Get a relationship by name or path

Specs

Returns all relationships of a resource

Specs

resource?(module()) :: boolean()

Whether or not a given module is a resource module

Link to this function

reverse_relationship(resource, path, acc \\ [])

View Source
Link to this function

selected?(record, field)

View Source

Specs

selected?(Ash.Resource.record(), atom()) :: boolean()
Link to this function

set_metadata(record, map)

View Source

Specs

set_metadata(Ash.Resource.record(), map()) :: Ash.Resource.record()

Specs

A list of all validations for the resource

Link to this function

validations(resource, type)

View Source

Specs

validations(Ash.Resource.t(), :create | :update | :destroy) :: [
  Ash.Resource.Validation.t()
]