View Source Ash.Resource.Builder (ash v2.4.19)

Tools for transforming resources in DSL Transformers.

Link to this section Summary

Functions

Builds and adds an attribute to a resource

Builds and adds an action

Builds and adds a create_timestamp to a resource

Builds and adds a new action unless an action with that name already exists

Builds and adds an attribute unless an attribute with that name already exists

Builds and adds a create_timestamp unless a create_timestamp with that name already exists

Builds and adds an update_timestamp unless an update_timestamp with that name already exists

Builds and adds an update_timestamp

Builds an action change

Builds an attribute with the given name, type, and options

Builds an create_timestamp with the given name, type, and options

Builds an update_timestamp with the given name, type, and options

Link to this section Functions

Link to this function

add_action(dsl_state, type, name, opts \\ [])

View Source
@spec add_action(
  Spark.Dsl.t(),
  type :: Ash.Resource.Actions.action_type(),
  name :: atom(),
  opts :: Keyword.t()
) :: Spark.Dsl.Builder.result()

Builds and adds an action

Link to this function

add_attribute(dsl_state, name, type, opts \\ [])

View Source
@spec add_attribute(
  Spark.Dsl.Builder.input(),
  name :: atom(),
  type :: Ash.Type.t(),
  opts :: Keyword.t()
) :: Spark.Dsl.Builder.result()

Builds and adds an attribute to a resource

Link to this function

add_change(dsl_state, ref, opts \\ [])

View Source
@spec add_change(
  Spark.Dsl.t(),
  ref :: module() | {module(), Keyword.t()},
  opts :: Keyword.t()
) :: Spark.Dsl.Builder.result()

Builds and adds an action

Link to this function

add_create_timestamp(dsl_state, name, opts \\ [])

View Source
@spec add_create_timestamp(
  Spark.Dsl.t(),
  name :: atom(),
  opts :: Keyword.t()
) :: Spark.Dsl.Builder.result()

Builds and adds a create_timestamp to a resource

Link to this function

add_new_action(dsl_state, type, name, opts \\ [])

View Source
@spec add_new_action(
  Spark.Dsl.t(),
  type :: Ash.Resource.Actions.action_type(),
  name :: atom(),
  opts :: Keyword.t()
) :: Spark.Dsl.Builder.result()

Builds and adds a new action unless an action with that name already exists

Link to this function

add_new_attribute(dsl_state, name, type, opts \\ [])

View Source
@spec add_new_attribute(
  Spark.Dsl.Builder.input(),
  name :: atom(),
  type :: Ash.Type.t(),
  opts :: Keyword.t()
) :: Spark.Dsl.Builder.result()

Builds and adds an attribute unless an attribute with that name already exists

Link to this function

add_new_create_timestamp(dsl_state, name, opts \\ [])

View Source
@spec add_new_create_timestamp(
  Spark.Dsl.Builder.input(),
  name :: atom(),
  opts :: Keyword.t()
) ::
  Spark.Dsl.Builder.result()

Builds and adds a create_timestamp unless a create_timestamp with that name already exists

Link to this function

add_new_update_timestamp(dsl_state, name, opts \\ [])

View Source
@spec add_new_update_timestamp(
  Spark.Dsl.Builder.input(),
  name :: atom(),
  opts :: Keyword.t()
) ::
  Spark.Dsl.Builder.result()

Builds and adds an update_timestamp unless an update_timestamp with that name already exists

Link to this function

add_update_timestamp(dsl_state, name, opts \\ [])

View Source
@spec add_update_timestamp(
  Spark.Dsl.Builder.input(),
  name :: atom(),
  opts :: Keyword.t()
) ::
  Spark.Dsl.Builder.result()

Builds and adds an update_timestamp

Link to this function

build_action(type, name, opts \\ [])

View Source
@spec build_action(
  type :: Ash.Resource.Actions.action_type(),
  name :: atom(),
  opts :: Keyword.t()
) :: {:ok, Ash.Resource.Actions.action()} | {:error, term()}

Builds an action

Link to this function

build_action_change(change, opts \\ [])

View Source
@spec build_action_change(change :: Ash.Resource.Change.ref(), opts :: Keyword.t()) ::
  {:ok, Ash.Resource.Change.t()} | {:error, term()}

Builds an action change

Link to this function

build_attribute(name, type, opts \\ [])

View Source
@spec build_attribute(name :: atom(), type :: Ash.Type.t(), opts :: Keyword.t()) ::
  {:ok, Ash.Resource.Attribute.t()} | {:error, term()}

Builds an attribute with the given name, type, and options

Link to this function

build_change(ref, opts \\ [])

View Source
@spec build_change(
  ref :: module() | {module(), Keyword.t()},
  opts :: Keyword.t()
) :: {:ok, Ash.Resource.Change.t()} | {:error, term()}

Builds a change

Link to this function

build_create_timestamp(name, opts \\ [])

View Source
@spec build_create_timestamp(name :: atom(), opts :: Keyword.t()) ::
  {:ok, Ash.Resource.Attribute.t()} | {:error, term()}

Builds an create_timestamp with the given name, type, and options

Link to this function

build_update_timestamp(name, opts \\ [])

View Source
@spec build_update_timestamp(name :: atom(), opts :: Keyword.t()) ::
  {:ok, Ash.Resource.Attribute.t()} | {:error, term()}

Builds an update_timestamp with the given name, type, and options