Jidoka.Effect.OperationRequest (Jidoka v0.9.0)

Copy Markdown View Source

Typed request payload for an operation effect.

Operation effects are still interpreted by runtime capabilities, but this struct defines the durable data shape those capabilities receive.

Summary

Functions

Normalizes an existing request, keyword list, or map.

Builds an operation request from keyword or map attributes.

Builds an operation request and raises if the attributes are invalid.

Returns the Zoi schema for an operation request.

Projects an operation request into an effect payload.

Types

t()

@type t() :: %Jidoka.Effect.OperationRequest{
  arguments: map(),
  loop_index: integer(),
  metadata: map(),
  name: binary(),
  request_id: nil | nil | binary()
}

Functions

from_input(request)

@spec from_input(t() | keyword() | map()) :: {:ok, t()} | {:error, term()}

Normalizes an existing request, keyword list, or map.

new(attrs)

@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}

Builds an operation request from keyword or map attributes.

new!(attrs)

@spec new!(keyword() | map()) :: t()

Builds an operation request and raises if the attributes are invalid.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for an operation request.

to_payload(request)

@spec to_payload(t()) :: map()

Projects an operation request into an effect payload.