A music player that connects to your cloud/distributed storage. diffuse.sh
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940module Sources.Refresh.AccessToken exposing (..)
import Json.Decode exposing (Decoder)import Sources exposing (Service)import Sources.Encoding exposing (serviceDecoder)
-- 🌳
type alias PortArguments = { service : Service , sourceId : String , accessToken : String
-- Unix timestamp in milliseconds , expiresAt : Int }
-- 🛠
portArgumentsDecoder : Decoder PortArgumentsportArgumentsDecoder = Json.Decode.map4 (\service sourceId accessToken expiresAt -> { service = service , sourceId = sourceId , accessToken = accessToken , expiresAt = expiresAt } ) (Json.Decode.field "service" serviceDecoder) (Json.Decode.field "sourceId" Json.Decode.string) (Json.Decode.field "accessToken" Json.Decode.string) (Json.Decode.field "expiresAt" Json.Decode.int)