Represents a resource in the API specification.
Resources are pure type/shape definitions. Fields and relationships are
stored as maps keyed by atom name for O(1) lookup. Actions live separately
in %Ash.Info.Manifest{}.entrypoints.
Summary
Functions
Returns relationships whose destination is in the allowed list, sorted by name.
Returns all fields as a list, sorted by name.
Returns all relationships as a list, sorted by name.
Returns all field names (attributes, calculations, aggregates), sorted.
Returns all fields of a given kind (:attribute, :calculation, or :aggregate), sorted by name.
Gets a field (attribute, calculation, or aggregate) by name.
Gets an identity by name.
Gets a relationship by name.
Checks if a field or relationship exists by name.
Returns all relationship names, sorted.
Types
@type t() :: %Ash.Info.Manifest.Resource{ custom: map(), description: String.t() | nil, embedded?: boolean(), fields: %{required(atom()) => Ash.Info.Manifest.Field.t()}, identities: %{required(atom()) => %{keys: [atom()]}}, module: atom(), multitenancy: %{strategy: atom(), global?: boolean(), attribute: atom()} | nil, name: String.t(), primary_key: [atom()], relationships: %{required(atom()) => Ash.Info.Manifest.Relationship.t()} }
Functions
@spec accessible_relationships(t(), [atom()] | MapSet.t()) :: [ Ash.Info.Manifest.Relationship.t() ]
Returns relationships whose destination is in the allowed list, sorted by name.
@spec all_fields(t()) :: [Ash.Info.Manifest.Field.t()]
Returns all fields as a list, sorted by name.
Sorting ensures codegen output is deterministic across runs (Erlang map iteration order is unstable for maps with more than 32 keys).
@spec all_relationships(t()) :: [Ash.Info.Manifest.Relationship.t()]
Returns all relationships as a list, sorted by name.
Returns all field names (attributes, calculations, aggregates), sorted.
@spec fields_by_kind(t(), Ash.Info.Manifest.Field.kind()) :: [ Ash.Info.Manifest.Field.t() ]
Returns all fields of a given kind (:attribute, :calculation, or :aggregate), sorted by name.
@spec get_field(t(), atom()) :: Ash.Info.Manifest.Field.t() | nil
Gets a field (attribute, calculation, or aggregate) by name.
Gets an identity by name.
@spec get_relationship(t(), atom()) :: Ash.Info.Manifest.Relationship.t() | nil
Gets a relationship by name.
Checks if a field or relationship exists by name.
Returns all relationship names, sorted.