Usage.fetch_with: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/usage.bend as Usage Lines 197-206 of cswap-bend-cli@0.1.0.0/usage.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/usage.bend&start_line=197&end_line=206 import Base import cswap-bend-cli@0.1.0.0/clock.bend as Clock import cswap-bend-cli@0.1.0.0/usage/cred.bend as UCred import cswap-bend-cli@0.1.0.0/usage/gate.bend as UGate # fetch_usage plus the 401 refresh of try_fetch_usage_for_account, over the # credential JSON text. Refreshes only inactive accounts. The rotated # credential comes back in `Fetched.credential` for the store to persist. # `gate` picks the refresh path: NoGate{} posts directly (tests); Gate{slot, # email, root} runs it under the slot's consume lock. def fetch_with(gate: UGate.Gate, +credential: String, is_active: Bool) -> IO(Fetched): do IO: now : U32 <- Clock.now_s() off : U32 <- local_offset() fetch.start(UCred.access_token(UCred.oauth.of(credential)), gate, credential, UCred.oauth.of(credential), is_active, now, off) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/clock.bend&name=now_s https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/cred.bend&name=access_token https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/cred.bend&name=oauth.of https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage/gate.bend&name=Gate https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage.bend&name=Fetched https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage.bend&name=fetch.start https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/usage.bend&name=local_offset