Specs
primary_action(Ash.resource(), Ash.action_type()) :: Ash.action() | nil
Returns the primary action of a given type
A resource is a static definition of an entity in your system.
Resource DSL documentation: Ash.Resource.Dsl
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
The data layer of the resource, or nil if it does not have one
Whether or not the data layer supports a specific feature
Custom functions supported by the data layer of the resource
Returns the configured default actions
A list of identities for the resource
Whether or not the data layer for the resource is currently in a transaction
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
Rolls back the current transaction
Wraps the execution of the function in a transaction with the resource's data_layer
A list of all validations for the resource
action(Ash.resource(), atom(), Ash.action_type()) :: Ash.action() | nil
Returns the action with the matching name and type on the resource
actions(Ash.resource()) :: [Ash.action()]
Returns all actions of a resource
aggregate(Ash.resource(), atom() | String.t()) :: Ash.aggregate() | nil
Get an aggregate by name
aggregates(Ash.resource()) :: [Ash.aggregate()]
Returns all aggregates of a resource
attribute(Ash.resource(), String.t() | atom()) :: Ash.attribute() | nil
Get an attribute name from the resource
attributes(Ash.resource()) :: [Ash.attribute()]
Returns all attributes of a resource
authorizers(Ash.resource()) :: [module()]
A list of authorizers to be used when accessing
base_filter(Ash.resource()) :: term()
calculation(Ash.resource(), atom() | String.t()) :: Ash.calculation() | nil
Get a calculation by name
calculations(Ash.resource()) :: [Ash.calculation()]
Returns all calculations of a resource
data_layer(Ash.resource()) :: Ash.data_layer()
The data layer of the resource, or nil if it does not have one
data_layer_can?(Ash.resource(), Ash.DataLayer.feature()) :: boolean()
Whether or not the data layer supports a specific feature
data_layer_functions(Ash.resource()) :: map()
Custom functions supported by the data layer of the resource
default_actions(Ash.resource()) :: [:create | :read | :update | :destroy]
Returns the configured default actions
description(Ash.resource()) :: String.t() | nil
embedded?(Ash.resource()) :: boolean()
extensions(Ash.resource()) :: [module()]
identities(Ash.resource()) :: [Ash.Resource.Identity.t()]
A list of identities for the resource
in_transaction?(Ash.resource()) :: boolean()
Whether or not the data layer for the resource is currently in a transaction
multitenancy_attribute(Ash.resource()) :: atom() | nil
multitenancy_global?(Ash.resource()) :: atom() | nil
multitenancy_parse_attribute(Ash.resource()) :: {atom(), atom(), [any()]}
multitenancy_source(Ash.resource()) :: atom() | nil
multitenancy_strategy(Ash.resource()) :: :context | :attribute | nil
Get the multitenancy strategy for a resource
multitenancy_template(Ash.resource()) :: atom() | nil
notifiers(Ash.resource()) :: [module()]
A list of notifiers to be used when accessing
primary_action(Ash.resource(), Ash.action_type()) :: Ash.action() | nil
Returns the primary action of a given type
primary_action!(Ash.resource(), Ash.action_type()) :: Ash.action() | no_return()
Returns the primary action of the given type
primary_key(Ash.resource()) :: [atom()]
A list of field names corresponding to the primary key
public_aggregate(Ash.resource(), atom() | String.t()) :: Ash.aggregate() | nil
Get an aggregate by name
public_aggregates(Ash.resource()) :: [Ash.aggregate()]
Returns all public aggregates of a resource
public_attribute(Ash.resource(), String.t() | atom()) :: Ash.attribute() | nil
Get a public attribute name from the resource
public_attributes(Ash.resource()) :: [Ash.attribute()]
Returns all public attributes of a resource
public_calculation(Ash.resource(), atom() | String.t()) :: Ash.calculation() | nil
Get a public calculation by name
public_calculations(Ash.resource()) :: [Ash.calculation()]
Returns all public calculations of a resource
Get a public relationship by name or path
public_relationships(Ash.resource()) :: [Ash.relationship()]
Returns all public relationships of a resource
relationship(Ash.resource(), atom() | String.t() | [atom() | String.t()]) :: Ash.relationship() | nil
Get a relationship by name or path
relationships(Ash.resource()) :: [Ash.relationship()]
Returns all relationships of a resource
Whether or not a given module is a resource module
rollback(Ash.resource(), term()) :: no_return()
Rolls back the current transaction
transaction(Ash.resource(), (() -> term())) :: term()
Wraps the execution of the function in a transaction with the resource's data_layer
validations(Ash.resource()) :: [Ash.validation()]
A list of all validations for the resource
validations(Ash.resource(), :create | :update | :destroy) :: [Ash.validation()]