def Client.json.of

bend-kube-runtime@0.2.0.0 · src/client.bend:527

import bend-kube-runtime@0.2.0.0/src/client.bend as Client
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J

527# A 2xx reply's body as JSON; any other status as the Status it carries.
528def Client.json.of(r: Result<&2, &2, KErr, Reply>) -> Result<&2, &2, KErr, J.Json>:
529  match r:
530    case Done{Reply{+c, body}}:
531      Client.json.status(c, J.Json.parse(body), Bool.and(U32.is_ge(c, 200), U32.is_lt(c, 300)))
532    case Fail{e}:
533      Fail{e}

Uses (9)

Used by (1)