JSON Decoders for Helix Stream responses
Use these pieces to pull out the parts your application needs.
import Twitch.Helix.Stream as Stream
import Json.Decode exposing (..)
streams : Decoder (List Stream)
streams = User.response stream
stream : Decoder Stream
stream =
succeed Stream
|> map2 (|>) Stream.id
|> map2 (|>) Stream.userId
|> map2 (|>) Stream.userName
|> map2 (|>) Stream.gameId
|> map2 (|>) Stream.viewerCount
|> map2 (|>) Stream.thumbnailUrl
|> map2 (|>) Stream.title
id : Json.Decode.Decoder Twitch.Helix.StreamId
Id of the stream
userId : Json.Decode.Decoder Twitch.Helix.UserId
Id of the channel the stream is on
userLogin : Json.Decode.Decoder String
Login of the channel the stream is on
userName : Json.Decode.Decoder String
Name of the channel the stream is on
gameId : Json.Decode.Decoder Twitch.Helix.GameId
Id of the game currently listed on the stream
gameName : Json.Decode.Decoder String
Name of the game currently listed on the stream
title : Json.Decode.Decoder String
Title of the stream
viewerCount : Json.Decode.Decoder Basics.Int
Viewer count
startedAt : Json.Decode.Decoder Time.Posix
Time the stream started
language : Json.Decode.Decoder String
Language code listed on the stream
thumbnailUrl : Json.Decode.Decoder String
Current thumbnail image
tagIds : Json.Decode.Decoder (List String)
List of tag ids
response : Json.Decode.Decoder a -> Json.Decode.Decoder (List a)
Decode individual records from the api response using the specified decoder
sampleStream : String
Sample data for streams