Decoding of successful API responses into their public structs.
This module is used internally by TypeSafe; you normally interact with the returned
TypeSafe.Response.SystemOne and TypeSafe.Response.ListModels structs rather than calling it
directly.
Summary
Functions
Decode a GET /v1/models body into a TypeSafe.Response.ListModels.
Decode a POST /v1/systemone body into a TypeSafe.Response.SystemOne.
Types
@type meta() :: %{ status: pos_integer(), headers: %{optional(String.t()) => String.t()}, request_id: String.t() | nil, endpoint: String.t() | nil, raw: term() }
HTTP metadata carried alongside a decoded body.
:status— response status code.:headers— map of lowercased header names to values.:request_id— thex-typesafe-request-idheader, ornil.:endpoint—"METHOD URL"without credentials, ornil.:raw— the underlyingReq.Response.
Functions
@spec parse_list_models(term(), meta()) :: {:ok, TypeSafe.Response.ListModels.t()} | {:error, TypeSafe.ResponseValidationError.t()}
Decode a GET /v1/models body into a TypeSafe.Response.ListModels.
@spec parse_system_one(term(), meta()) :: {:ok, TypeSafe.Response.SystemOne.t()} | {:error, TypeSafe.ResponseValidationError.t()}
Decode a POST /v1/systemone body into a TypeSafe.Response.SystemOne.