#
View Source Ash.ActionInput (ash v2.14.2)

Input for a custom action

# Link to this section Summary

## Types

t()

## Functions

add_error(input, errors, path \\ [])

Adds an error to the input errors list, and marks the input as `valid?: false`

for_action(resource_or_input, action, params, opts \\ [])

Creates a new input for a generic action

set_argument(input, argument, value)

Set an argument value

set_context(input, map)

Deep merges the provided map into the input context that can be used later

# Link to this section Types

Link to this type

# t()

View Source

    @type t() :: %Ash.ActionInput{
      action: Ash.Resource.Actions.Action.t(),
      api: Ash.Api.t(),
      arguments: map(),
      context: map(),
      errors: term(),
      params: map(),
      resource: Ash.Resource.t(),
      valid?: boolean()
    }

# Link to this section Functions

Link to this function

# add_error(input, errors, path \\ [])

View Source

Adds an error to the input errors list, and marks the input as `valid?: false`

Link to this function

# for_action(resource_or_input, action, params, opts \\ [])

View Source

    @spec for_action(
      resource_or_input :: Ash.Resource.t() | t(),
      action :: atom(),
      params :: map(),
      opts :: Keyword.t()
    ) :: t()

Creates a new input for a generic action

Link to this function

# set_argument(input, argument, value)

View Source

    @spec set_argument(input :: t(), name :: atom(), value :: term()) :: t()

Set an argument value

Link to this function

# set_context(input, map)

View Source

    @spec set_context(t(), map() | nil) :: t()

Deep merges the provided map into the input context that can be used later

Do not use the `private` key in your custom context, as that is reserved for internal use.