def switch_auto
cswap-bend-cli@0.1.0.0 · switch.bend:259
import cswap-bend-cli@0.1.0.0/switch.bend as Switch
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/store.bend as Store
import cswap-bend-cli@0.1.0.0/swbase.bend as B
import cswap-bend-cli@0.1.0.0/swlive.bend as L
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/store/io.bend as SIo
259
260
261
262
263
264
265
266def switch_auto(+ctx: SBase.Ctx, +strategy: String, +models: List<&2, String>, +opts: L.Opts) -> Act.of(Json.Json):
267 do ActM<Json.Json>:
268 m : Maybe<&2, Json.Json> <- SIo.read_seq(SBase.root_of(ctx))
269 auto1(strategy, ctx, B.sel_s(String.eq(strategy, "best") || String.eq(strategy, "next-available"), strategy, "rotation"), B.sel_ls(String.eq(strategy, "best") || String.eq(strategy, "next-available"), models, []), opts, m)