Current section
Files
Jump to
Current section
Files
lib/crawlberg/action_result.ex
# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:e0600612767fdd3d51e9128afdb0ffcd1fb490e9942f3839a5120ab7a4e3b658
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Crawlberg.ActionResult do
@moduledoc "Result from a single page action execution."
@typedoc "Result from a single page action execution."
@type t :: %__MODULE__{
action_index: non_neg_integer(),
action_type: String.t() | nil,
success: boolean(),
data: String.t() | nil,
error: String.t() | nil
}
defstruct action_index: 0,
action_type: nil,
success: false,
data: nil,
error: nil
defimpl Jason.Encoder do
@doc false
def encode(value, opts) do
value
|> Map.from_struct()
|> Enum.reject(fn {_k, v} -> v == nil end)
|> Enum.into(%{})
|> Jason.Encoder.encode(opts)
end
end
end