@spec primary_action( Spark.Dsl.t() | Ash.Resource.t(), Ash.Resource.Actions.action_type() ) :: Ash.Resource.Actions.action() | nil
Returns the primary action of a given type
Introspection for resources
Returns the action with the matching name and type on the resource
Returns true or false if the input is accepted by the action, as an argument or an attribute
Returns the list of possible accepted keys by an action
Returns all actions of a resource
Get an aggregate by name
Gets the type of an aggregate for a given resource.
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
The base filter of the resource
Get a calculation by name
Get an calculation interface by name from the resource
The list of code interface calculation definitions.
Returns all calculations of a resource
A list of all changes for the resource
A list of all changes for the resource for a given action type
The domain to define the interface for, when defining it in the resource
The data layer of the resource, or nil if it does not have one
Returns the configured default actions
The default context of the resource
Whether or not to define the interface on the resource
The description of the resource
Returns the statically configured domain for the resource.
Whether or not the resource is an embedded resource
Get a field from a resource by name
Returns all attributes, aggregates, calculations and relationships of a resource
A list of identities for the resource
Get an identity by name from the resource
Get an interface by name from the resource
The list of code interface definitions.
Returns all attributes of a resource with lazy matching defaults
Returns all attributes of a resource with lazy non-matching-defaults
The multitenancy attribute for a resource
The MFA to parse the tenant from the attribute
The function to parse the tenant from the attribute
The multitenancy strategy for a resource
The template for creating the tenant name
A list of notifiers to be used when accessing
The plural_name of the resource
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
Whether or not all primary key attributes can be compared with simple_equality
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 field from a resource by name
Returns all public attributes, aggregates, calculations and relationships 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
The required belongs_to relationships
Whether or not a given module is a resource module
Retrieves a relationship path from the resource related by path, to the provided resource.
The short_name of the resource
A list of simple notifiers (require no DSL, used to avoid compile time dependencies)
Determine if a field is sortable by name
Returns all attributes of a resource with static defaults
The trace_name of the resource
A list of unique keys and information for a resource
A list of all validations for the resource
A list of all validations for the resource for a given action type
@spec action( Spark.Dsl.t() | Ash.Resource.t(), atom(), Ash.Resource.Actions.action_type() | nil ) :: Ash.Resource.Actions.action() | nil
Returns the action with the matching name and type on the resource
@spec action_input?(Ash.Resource.t(), action :: atom(), input :: atom() | String.t()) :: boolean()
Returns true or false if the input is accepted by the action, as an argument or an attribute
@spec action_inputs(Ash.Resource.t(), action :: atom()) :: MapSet.t()
Returns the list of possible accepted keys by an action
@spec actions(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Actions.action()]
Returns all actions of a resource
@spec aggregate(Spark.Dsl.t() | Ash.Resource.t(), atom() | String.t()) :: Ash.Resource.Aggregate.t() | nil
Get an aggregate by name
@spec aggregate_type( Spark.Dsl.t() | Ash.Resource.t(), Ash.Resource.Aggregate.t() | atom() ) :: {:ok, Ash.Type.t()} | {:error, String.t()}
Gets the type of an aggregate for a given resource.
@spec aggregates(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Aggregate.t()]
Returns all aggregates of a resource
@spec always_selected_attribute_names(Spark.Dsl.t() | Ash.Resource.t()) :: MapSet.t()
@spec attribute(Spark.Dsl.t() | Ash.Resource.t(), String.t() | atom()) :: Ash.Resource.Attribute.t() | nil
Get an attribute name from the resource
@spec attribute_names(Spark.Dsl.t() | Ash.Resource.t()) :: MapSet.t()
@spec attributes(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Attribute.t()]
Returns all attributes of a resource
@spec authorizers(Spark.Dsl.t() | Ash.Resource.t()) :: [module()]
A list of authorizers to be used when accessing
@spec base_filter(Spark.Dsl.t() | Ash.Resource.t()) :: term()
The base filter of the resource
@spec calculation(Spark.Dsl.t() | Ash.Resource.t(), atom() | String.t()) :: Ash.Resource.Calculation.t() | nil
Get a calculation by name
@spec calculation_interface(Spark.Dsl.t() | Ash.Resource.t(), atom()) :: Ash.Resource.CalculationInterface.t() | nil
Get an calculation interface by name from the resource
@spec calculation_interfaces(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.CalculationInterface.t() ]
The list of code interface calculation definitions.
@spec calculations(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Calculation.t()]
Returns all calculations of a resource
@spec changes(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.Validation.t() | Ash.Resource.Change.t() ]
A list of all changes for the resource
@spec changes(Spark.Dsl.t() | Ash.Resource.t(), :create | :update | :destroy) :: [ Ash.Resource.Validation.t() | Ash.Resource.Change.t() ]
A list of all changes for the resource for a given action type
@spec code_interface_domain(Spark.Dsl.t() | Ash.Resource.t()) :: atom() | nil
The domain to define the interface for, when defining it in the resource
@spec data_layer(Ash.Resource.t()) :: Ash.DataLayer.t() | nil
The data layer of the resource, or nil if it does not have one
@spec default_actions(Spark.Dsl.t() | Ash.Resource.t()) :: [ :create | :read | :update | :destroy ]
Returns the configured default actions
@spec default_context(Spark.Dsl.t() | Ash.Resource.t()) :: term()
The default context of the resource
@spec define_interface?(Spark.Dsl.t() | Ash.Resource.t()) :: boolean()
Whether or not to define the interface on the resource
@spec description(Spark.Dsl.t() | Ash.Resource.t()) :: String.t() | nil
The description of the resource
Returns the statically configured domain for the resource.
@spec embedded?(Spark.Dsl.t() | Ash.Resource.t()) :: boolean()
Whether or not the resource is an embedded resource
@spec field(Spark.Dsl.t() | Ash.Resource.t(), String.t() | atom()) :: Ash.Resource.Attribute.t() | Ash.Resource.Aggregate.t() | Ash.Resource.Calculation.t() | Ash.Resource.Relationships.relationship() | nil
Get a field from a resource by name
@spec fields( Spark.Dsl.t() | Ash.Resource.t(), types :: [:attributes | :aggregates | :calculations | :relationships] ) :: [ Ash.Resource.Attribute.t() | Ash.Resource.Aggregate.t() | Ash.Resource.Calculation.t() | Ash.Resource.Relationships.relationship() ]
Returns all attributes, aggregates, calculations and relationships of a resource
@spec identities(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Identity.t()]
A list of identities for the resource
@spec identity(Spark.Dsl.t() | Ash.Resource.t(), atom()) :: Ash.Resource.Identity.t() | nil
Get an identity by name from the resource
@spec interface(Spark.Dsl.t() | Ash.Resource.t(), atom()) :: Ash.Resource.Interface.t() | nil
Get an interface by name from the resource
@spec interfaces(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Interface.t()]
The list of code interface definitions.
@spec lazy_matching_default_attributes( Spark.Dsl.t() | Ash.Resource.t(), type :: :create | :update ) :: [Ash.Resource.Attribute.t()]
Returns all attributes of a resource with lazy matching defaults
@spec lazy_non_matching_default_attributes( Spark.Dsl.t() | Ash.Resource.t(), type :: :create | :update ) :: [Ash.Resource.Attribute.t()]
Returns all attributes of a resource with lazy non-matching-defaults
@spec multitenancy_attribute(Spark.Dsl.t() | Ash.Resource.t()) :: atom() | nil
The multitenancy attribute for a resource
@spec multitenancy_global?(Spark.Dsl.t() | Ash.Resource.t()) :: atom() | nil
The MFA to parse the tenant from the attribute
@spec multitenancy_parse_attribute(Spark.Dsl.t() | Ash.Resource.t()) :: {atom(), atom(), [any()]}
The function to parse the tenant from the attribute
@spec multitenancy_strategy(Spark.Dsl.t() | Ash.Resource.t()) :: :context | :attribute | nil
The multitenancy strategy for a resource
@spec multitenancy_template(Spark.Dsl.t() | Ash.Resource.t()) :: atom() | nil
The template for creating the tenant name
@spec notifiers(Spark.Dsl.t() | Ash.Resource.t()) :: [module()]
A list of notifiers to be used when accessing
The plural_name of the resource
@spec preparations(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Preparation.t()]
@spec primary_action( Spark.Dsl.t() | Ash.Resource.t(), Ash.Resource.Actions.action_type() ) :: Ash.Resource.Actions.action() | nil
Returns the primary action of a given type
@spec primary_action!( Spark.Dsl.t() | Ash.Resource.t(), Ash.Resource.Actions.action_type() ) :: Ash.Resource.Actions.action() | no_return()
Returns the primary action of the given type
@spec primary_key(Spark.Dsl.t() | Ash.Resource.t()) :: [atom()]
A list of field names corresponding to the primary key
@spec primary_key_simple_equality?(Spark.Dsl.t() | Ash.Resource.t()) :: boolean()
Whether or not all primary key attributes can be compared with simple_equality
@spec public_aggregate(Spark.Dsl.t() | Ash.Resource.t(), atom() | String.t()) :: Ash.Resource.Aggregate.t() | nil
Get an aggregate by name
@spec public_aggregates(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.Aggregate.t() ]
Returns all public aggregates of a resource
@spec public_attribute(Spark.Dsl.t() | Ash.Resource.t(), String.t() | atom()) :: Ash.Resource.Attribute.t() | nil
Get a public attribute name from the resource
@spec public_attributes(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.Attribute.t() ]
Returns all public attributes of a resource
@spec public_calculation(Spark.Dsl.t() | Ash.Resource.t(), atom() | String.t()) :: Ash.Resource.Calculation.t() | nil
Get a public calculation by name
@spec public_calculations(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.Calculation.t() ]
Returns all public calculations of a resource
@spec public_field(Spark.Dsl.t() | Ash.Resource.t(), String.t() | atom()) :: Ash.Resource.Attribute.t() | Ash.Resource.Aggregate.t() | Ash.Resource.Calculation.t() | Ash.Resource.Relationships.relationship() | nil
Get a public field from a resource by name
@spec public_fields(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.Attribute.t() | Ash.Resource.Aggregate.t() | Ash.Resource.Calculation.t() | Ash.Resource.Relationships.relationship() ]
Returns all public attributes, aggregates, calculations and relationships of a resource
Get a public relationship by name or path
@spec public_relationships(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.Relationships.relationship() ]
Returns all public relationships of a resource
@spec relationship( Spark.Dsl.t() | Ash.Resource.t(), atom() | String.t() | [atom() | String.t()] ) :: Ash.Resource.Relationships.relationship() | nil
Get a relationship by name or path
@spec relationships(Spark.Dsl.t() | Ash.Resource.t()) :: [ Ash.Resource.Relationships.relationship() ]
Returns all relationships of a resource
The required belongs_to relationships
Whether or not a given module is a resource module
Retrieves a relationship path from the resource related by path, to the provided resource.
@spec short_name(Spark.Dsl.t() | Ash.Resource.t()) :: atom() | nil
The short_name of the resource
@spec simple_notifiers(Spark.Dsl.t() | Ash.Resource.t()) :: [module()]
A list of simple notifiers (require no DSL, used to avoid compile time dependencies)
@spec sortable?(Spark.Dsl.t() | Ash.Resource.t(), String.t() | atom(), pagination_type: Ash.Page.type(), include_private?: boolean() ) :: boolean()
Determine if a field is sortable by name
@spec static_default_attributes( Spark.Dsl.t() | Ash.Resource.t(), type :: :create | :update ) :: [Ash.Resource.Attribute.t()]
Returns all attributes of a resource with static defaults
@spec trace_name(Spark.Dsl.t() | Ash.Resource.t()) :: String.t() | nil
The trace_name of the resource
@spec unique_keys(Spark.Dsl.t() | Ash.Resource.t()) :: [ %{type: atom(), keys: [atom()], nils_distinct?: boolean()} ]
A list of unique keys and information for a resource
@spec validations(Spark.Dsl.t() | Ash.Resource.t()) :: [Ash.Resource.Validation.t()]
A list of all validations for the resource
@spec validations(Spark.Dsl.t() | Ash.Resource.t(), :create | :update | :destroy) :: [ Ash.Resource.Validation.t() ]
A list of all validations for the resource for a given action type