Scylla/src/Scylla/UserData.elm

15 lines
503 B
Elm
Raw Normal View History

2018-12-13 02:15:14 -08:00
module Scylla.UserData exposing (..)
import Json.Decode as Decode exposing (Decoder, int, string, float, list, value, dict, bool, field)
import Json.Decode.Pipeline exposing (required, optional)
type alias UserData =
{ displayName : Maybe String
, avatarUrl : Maybe String
}
userDataDecoder : Decoder UserData
userDataDecoder =
Decode.succeed UserData
|> optional "displayname" (Decode.map Just string) Nothing
|> optional "avatar_url" (Decode.map Just string) Nothing