View Source Jido.Actions.Files.DeleteFile (Jido v1.0.0)

Deletes a file or directory

Summary

Functions

category()

description()

name()

on_after_run(result)

Callback implementation for Jido.Action.on_after_run/1.

on_after_validate_params(params)

Callback implementation for Jido.Action.on_after_validate_params/1.

on_before_validate_params(params)

Callback implementation for Jido.Action.on_before_validate_params/1.

on_error(failed_params, error, context, opts)

Callback implementation for Jido.Action.on_error/4.

run(params, context)

@spec run(map(), map()) :: {:ok, map()} | {:error, any()}

Executes the Action with the given parameters and context.

The run/2 function must be implemented in the module using Jido.Action.

schema()

tags()

to_json()

validate_params(params)

@spec validate_params(map()) :: {:ok, map()} | {:error, String.t()}

Validates the input parameters for the Action.

Examples

iex> defmodule ExampleAction do
...>   use Jido.Action,
...>     name: "example_action",
...>     schema: [
...>       input: [type: :string, required: true]
...>     ]
...> end
...> ExampleAction.validate_params(%{input: "test"})
{:ok, %{input: "test"}}

iex> ExampleAction.validate_params(%{})
{:error, "Invalid parameters for Action: Required key :input not found"}

vsn()