SudregEx.Response (sudreg_ex v0.1.0)

Copy Markdown View Source

A successful Sudski registar API response: the decoded data plus the metadata the service returns in X-* headers.

data is whatever Req produced — a decoded list/map for JSON, a raw string otherwise (XML, or an empty body). Numeric headers are integer-parsed; seconds_elapsed and timestamp stay raw strings (the timestamp is timezone-less, so parsing is left to the caller).

Note: log_id appears here (integer-parsed, on success) and on SudregEx.Error (verbatim, possibly a string, on a JSON error) — a deliberate asymmetry between the success and error envelopes.

Summary

Types

t()

@type t() :: %SudregEx.Response{
  data: term(),
  headers: map(),
  http_status: pos_integer() | nil,
  log_id: integer() | nil,
  rows_returned: integer() | nil,
  seconds_elapsed: String.t() | nil,
  snapshot_id: integer() | nil,
  timestamp: String.t() | nil,
  total_count: integer() | nil
}