Liking cljdoc? Tell your friends :D

midas.client

MIDAS API client.

Spec-driven HTTP client built on Martian. The OpenAPI spec bundled in resources/midas-spec/openapi.yaml is the single source of truth for endpoint definitions and parameter validation.

This is a read-only CONSUMER client. In MIDAS v2.0 all public GET endpoints are unauthenticated — use (create-anonymous-client) and skip the token entirely. A bearer token is only needed for uploads (POST), which require CEC-issued utility credentials; the authenticated flow below exists for utility data providers and is not exercised by non-utility consumers.

Authenticated flow (utility uploads only):

  1. Call (get-token username password) to obtain a 10-minute bearer token
  2. Call (create-client token) to create an authenticated Martian client
  3. Use the client with API functions (rin-list, rate-values, etc.)
MIDAS API client.

Spec-driven HTTP client built on Martian. The OpenAPI spec bundled in
resources/midas-spec/openapi.yaml is the single source of truth for
endpoint definitions and parameter validation.

This is a read-only CONSUMER client. In MIDAS v2.0 all public GET endpoints
are unauthenticated — use (create-anonymous-client) and skip the token
entirely. A bearer token is only needed for uploads (POST), which require
CEC-issued utility credentials; the authenticated flow below exists for
utility data providers and is not exercised by non-utility consumers.

Authenticated flow (utility uploads only):
  1. Call (get-token username password) to obtain a 10-minute bearer token
  2. Call (create-client token) to create an authenticated Martian client
  3. Use the client with API functions (rin-list, rate-values, etc.)
raw docstring

midas.entities

MIDAS entity coercion: raw API responses → idiomatic Clojure maps.

Two-layer data model: Raw layer — direct JSON→EDN, PascalCase keys, string values Coerced layer — namespaced keywords, native types (java.time, BigDecimal)

Time handling: every coerced timestamp is a ZonedDateTime in the zone configured on the client (per-instance via :zone, default America/Los_Angeles). MIDAS mixes Z-suffixed UTC fields with bare wall-clock fields on the wire; both are normalised to ZonedDateTime in the configured zone — the instant is preserved for Z-suffixed values and assumed-zone-local for bare values. See https://github.com/grid-coordination/midas-api-specs/blob/main/doc/datetime-and-timezone.md

All coerced entities carry the original raw data as :midas/raw metadata.

MIDAS entity coercion: raw API responses → idiomatic Clojure maps.

Two-layer data model:
  Raw layer   — direct JSON→EDN, PascalCase keys, string values
  Coerced layer — namespaced keywords, native types (java.time, BigDecimal)

Time handling: every coerced timestamp is a `ZonedDateTime` in the zone
configured on the client (per-instance via `:zone`, default
`America/Los_Angeles`). MIDAS mixes Z-suffixed UTC fields with bare
wall-clock fields on the wire; both are normalised to ZonedDateTime in
the configured zone — the instant is preserved for Z-suffixed values
and assumed-zone-local for bare values. See
https://github.com/grid-coordination/midas-api-specs/blob/main/doc/datetime-and-timezone.md

All coerced entities carry the original raw data as :midas/raw metadata.
raw docstring

midas.entities.schema

Malli schemas for coerced MIDAS entities (the public contract).

Malli schemas for coerced MIDAS entities (the public contract).
raw docstring

midas.entities.schema.raw

Malli schemas for raw MIDAS API responses (boundary validation).

Malli schemas for raw MIDAS API responses (boundary validation).
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close