def human2
cswap-bend-cli@0.1.0.0 · daemon/events.bend:235
import cswap-bend-cli@0.1.0.0/daemon/events.bend as Events
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
235def human2(+kind: String, +e: Json.Json) -> String:
236 sel(String.eq(kind, "poll"), poll_text(e),
237 sel(String.eq(kind, "switch"), switch_text(e),
238 sel(String.eq(kind, "no-switch"), "no switch: " ++ f_of(e, "reason") ++ detail_text(f_of(e, "detail")),
239 sel(String.eq(kind, "all-exhausted"), "all accounts exhausted; earliest reset " ++ f_of(e, "earliestResetAt"),
240 sel(String.eq(kind, "account-quarantined"), "Account-" ++ f_of(e, "number") ++ " (" ++ f_of(e, "email") ++ ") quarantined: " ++ f_of(e, "reason"),
241 sel(String.eq(kind, "account-unquarantined"), "Account-" ++ f_of(e, "number") ++ " (" ++ f_of(e, "email") ++ ") back in rotation (" ++ f_of(e, "reason") ++ ")",
242 sel(String.eq(kind, "sleep"), "sleeping " ++ f_of(e, "seconds") ++ "s (until " ++ f_of(e, "until") ++ ")",
243 sel(String.eq(kind, "error"), "error: " ++ f_of(e, "message") ++ " (will retry)",
244 "warning: " ++ f_of(e, "message")))))))))