ash v0.1.9 Ash View Source

The primary interface for interrogating apis and resources.

These are tools for interrogating resources to derive behavior based on their configuration. This is how all of the behavior of Ash is ultimately configured.

Link to this section Summary

Functions

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

A list of all actions on the resource

Get an attribute name from the resource

A list of all attributes on the resource

A list of authorizers to be used when accessing the resource

The data layer of the resource, or nil if it does not have one

A short description of the resource, to be included in autogenerated documentation

The name of the resource, e.g 'posts'

Returns the primary action of a given type for a resource

A list of field names corresponding to the primary key of a resource

Gets a relationship by name from the resource

A list of relationships on the resource

A list of resource modules for a given API

The type of the resource, e.g 'post'

Link to this section Types

Link to this type

action()

View Source
action() ::
  Ash.Resource.Actions.Create.t()
  | Ash.Resource.Actions.Read.t()
  | Ash.Resource.Actions.Update.t()
  | Ash.Resource.Actions.Destroy.t()
Link to this type

attribute()

View Source
attribute() :: Ash.Resource.Attributes.Attribute.t()
Link to this type

cardinality_many_relationship()

View Source
cardinality_many_relationship() ::
  Ash.Resource.Relationships.HasMany.t()
  | Ash.Resource.Relationships.ManyToMany.t()
Link to this type

cardinality_one_relationship()

View Source
cardinality_one_relationship() ::
  Ash.Resource.Relationships.HasOne.t()
  | Ash.Resource.Relationships.BelongsTo.t()
Link to this type

create_params()

View Source
create_params() :: Keyword.t()
Link to this type

data_layer()

View Source
data_layer() :: module()
Link to this type

data_layer_query()

View Source
data_layer_query() :: struct()
Link to this type

delete_params()

View Source
delete_params() :: Keyword.t()
Link to this type

relationship_cardinality()

View Source
relationship_cardinality() :: :many | :one
Link to this type

resource()

View Source
resource() :: module()
Link to this type

side_loads()

View Source
side_loads() :: Keyword.t()
Link to this type

update_params()

View Source
update_params() :: Keyword.t()

Link to this section Functions

Link to this function

action(resource, name, type)

View Source
action(resource(), atom(), atom()) :: action() | nil

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

Link to this function

actions(resource)

View Source
actions(resource()) :: [action()]

A list of all actions on the resource

Link to this function

attribute(resource, name)

View Source
attribute(resource(), String.t() | atom()) :: attribute() | nil

Get an attribute name from the resource

Link to this function

attributes(resource)

View Source
attributes(resource()) :: [attribute()]

A list of all attributes on the resource

Link to this function

authorizers(resource)

View Source
authorizers(resource()) :: [module()]

A list of authorizers to be used when accessing the resource

Link to this function

data_layer(resource)

View Source
data_layer(resource()) :: data_layer()

The data layer of the resource, or nil if it does not have one

Link to this function

describe(resource)

View Source
describe(resource()) :: String.t()

A short description of the resource, to be included in autogenerated documentation

The name of the resource, e.g 'posts'

Link to this function

primary_action(resource, type)

View Source
primary_action(resource(), atom()) :: action() | nil

Returns the primary action of a given type for a resource

Link to this function

primary_key(resource)

View Source
primary_key(resource()) :: [atom()]

A list of field names corresponding to the primary key of a resource

Link to this function

relationship(resource, relationship_name)

View Source
relationship(resource(), atom() | String.t()) :: relationship() | nil

Gets a relationship by name from the resource

Link to this function

relationships(resource)

View Source
relationships(resource()) :: [relationship()]

A list of relationships on the resource

Link to this function

resources(api)

View Source
resources(api()) :: [resource()]

A list of resource modules for a given API

The type of the resource, e.g 'post'