AshReports.Parameter (ash_reports v0.1.0)

Represents a runtime parameter that can be passed to a report.

Summary

Functions

Creates a new Parameter struct with the given name, type, and options.

Validates a value against this parameter's type and constraints.

Types

t()

@type t() :: %AshReports.Parameter{
  constraints: Keyword.t(),
  default: any(),
  name: atom(),
  required: boolean(),
  type: atom()
}

Functions

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

@spec new(atom(), atom(), Keyword.t()) :: t()

Creates a new Parameter struct with the given name, type, and options.

validate_value(param, value)

@spec validate_value(t(), any()) :: {:ok, any()} | {:error, String.t()}

Validates a value against this parameter's type and constraints.