{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module Battlesnake.API.InfoResponse where
import Data.Aeson (ToJSON, Value (String), toJSON)
import Data.Text
import GHC.Generics
data APIVersion = APIVersion1 deriving (Int -> APIVersion -> ShowS
[APIVersion] -> ShowS
APIVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [APIVersion] -> ShowS
$cshowList :: [APIVersion] -> ShowS
show :: APIVersion -> String
$cshow :: APIVersion -> String
showsPrec :: Int -> APIVersion -> ShowS
$cshowsPrec :: Int -> APIVersion -> ShowS
Show)
instance ToJSON APIVersion where
toJSON :: APIVersion -> Value
toJSON APIVersion
APIVersion1 = Text -> Value
String Text
"1"
data InfoResponse = InfoResponse
{ InfoResponse -> APIVersion
apiversion :: APIVersion
, InfoResponse -> Maybe Text
author :: Maybe Text
, InfoResponse -> Maybe Text
color :: Maybe Text
, InfoResponse -> Maybe Text
head :: Maybe Text
, InfoResponse -> Maybe Text
tail :: Maybe Text
, InfoResponse -> Maybe Text
version :: Maybe Text
}
deriving (Int -> InfoResponse -> ShowS
[InfoResponse] -> ShowS
InfoResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InfoResponse] -> ShowS
$cshowList :: [InfoResponse] -> ShowS
show :: InfoResponse -> String
$cshow :: InfoResponse -> String
showsPrec :: Int -> InfoResponse -> ShowS
$cshowsPrec :: Int -> InfoResponse -> ShowS
Show, forall x. Rep InfoResponse x -> InfoResponse
forall x. InfoResponse -> Rep InfoResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InfoResponse x -> InfoResponse
$cfrom :: forall x. InfoResponse -> Rep InfoResponse x
Generic)
instance ToJSON InfoResponse