View Source AshAuthentication.Validations.Action (ash_authentication v4.3.5)

Validation helpers for Resource actions.

Summary

Functions

Validate an action's argument has an option set to one of the provided values.

Validate that a named action actually exists.

Validate the presence of an argument on an action.

Validate the presence of the named change module on an action.

Validate the presence of the named manual module on an action.

Validate the presence of the named preparation module on an action.

Validate the presence of the named validation module on an action.

Validate the action has the provided option.

Functions

validate_action_argument_option(action, argument_name, field, values)

@spec validate_action_argument_option(Ash.Resource.Actions.action(), atom(), atom(), [
  any()
]) ::
  :ok | {:error, Exception.t() | String.t()}

Validate an action's argument has an option set to one of the provided values.

validate_action_exists(dsl_state, action_name)

@spec validate_action_exists(map(), atom()) ::
  {:ok, Ash.Resource.Actions.action()} | {:error, Exception.t() | String.t()}

Validate that a named action actually exists.

validate_action_has_argument(action, argument_name)

@spec validate_action_has_argument(Ash.Resource.Actions.action(), atom()) ::
  :ok | {:error, Exception.t()}

Validate the presence of an argument on an action.

validate_action_has_change(action, change_module)

@spec validate_action_has_change(Ash.Resource.Actions.action(), module()) ::
  :ok | {:error, Exception.t()}

Validate the presence of the named change module on an action.

validate_action_has_manual(action, manual_module)

@spec validate_action_has_manual(Ash.Resource.Actions.action(), module()) ::
  :ok | {:error, Exception.t()}

Validate the presence of the named manual module on an action.

validate_action_has_preparation(action, preparation_module)

@spec validate_action_has_preparation(Ash.Resource.Actions.action(), module()) ::
  :ok | {:error, Exception.t()}

Validate the presence of the named preparation module on an action.

validate_action_has_validation(action, validation_module)

@spec validate_action_has_validation(Ash.Resource.Actions.action(), module()) ::
  :ok | {:error, Exception.t()}

Validate the presence of the named validation module on an action.

validate_action_option(action, field, values)

@spec validate_action_option(Ash.Resource.Actions.action(), atom(), [any()]) ::
  :ok | {:error, Exception.t()}

Validate the action has the provided option.