Jidoka.Review.Response (Jidoka v0.8.0-beta.1)

Copy Markdown View Source

Application response to a pending review request.

A response is intentionally small: it targets a single interrupt and either approves or denies the pending operation.

Summary

Types

decision()

@type decision() :: :approved | :denied

t()

@type t() :: %Jidoka.Review.Response{
  decision: (:approved | :denied) | binary(),
  interrupt_id: binary(),
  metadata: map(),
  reason: nil | nil | any(),
  responded_at_ms: nil | nil | integer()
}

Functions

approve(interrupt_or_id, opts \\ [])

@spec approve(
  Jidoka.Review.Interrupt.t() | String.t(),
  keyword()
) :: t()

decisions()

@spec decisions() :: [decision()]

deny(interrupt_or_id, opts \\ [])

@spec deny(
  Jidoka.Review.Interrupt.t() | String.t(),
  keyword()
) :: t()

from_input(response)

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

new(attrs)

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

new!(attrs)

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

schema()

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