Raxol.AgentClientProtocol.Schema.Cost (Raxol Agent Client Protocol v0.1.0)

Copy Markdown View Source

Cumulative session cost information -- the optional cost field of UsageUpdate.

Not present in f1729; ported straight from the pinned v1.19.0 oracle schema (priv/schema-oracle/v1/schema.json, $defs/Cost), no upstream attribution. amount/currency are both required (no x-deserialize-default-on-error on either in the oracle).

Summary

Functions

Total: never raises. A missing/non-number amount or missing/non-string currency is the only failure mode (both required).

Types

t()

@type t() :: %Raxol.AgentClientProtocol.Schema.Cost{
  _meta: map(),
  amount: number(),
  currency: String.t()
}

Functions

from_json(map)

@spec from_json(term()) :: {:ok, t()} | {:error, term()}

Total: never raises. A missing/non-number amount or missing/non-string currency is the only failure mode (both required).

new(amount, currency)

@spec new(number(), String.t()) :: t()

to_json(c)

@spec to_json(t()) :: map()