X3m.System.Response (X3m System v0.9.0)

Copy Markdown View Source

Summary

Types

t()

@type t() ::
  :ok
  | {:ok, any()}
  | {:ok, any(), integer()}
  | {:created, any()}
  | {:created, any(), integer()}
  | {:service_unavailable, atom()}
  | {:service_timeout, atom(), String.t(), non_neg_integer()}
  | {:validation_error, map()}
  | {:missing_id, atom() | String.t()}
  | {:error, any()}

Functions

created(id)

@spec created(any()) :: {:created, any()}

error(any)

@spec error(any()) :: {:error, any()}

missing_id(id_field)

@spec missing_id(atom() | String.t()) :: {:missing_id, atom() | String.t()}

ok()

@spec ok() :: :ok

ok(payload)

@spec ok(any()) :: {:ok, any()}

service_timeout(msg_name, req_id, timeout)

@spec service_timeout(atom(), String.t(), non_neg_integer()) ::
  {:service_timeout, atom(), String.t(), non_neg_integer()}

service_unavailable(msg_name)

@spec service_unavailable(atom()) :: {:service_unavailable, atom()}

unauthorized(msg)

@spec unauthorized(String.t()) :: {:unauthorized, String.t()}

validation_error(request)

@spec validation_error(map()) :: {:validation_error, map()}