{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Fonts.Types.Sum where
import Network.Google.Prelude hiding (Bytes)
data WebfontsListSort
= Alpha
| Date
| Popularity
| Style
| Trending
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable WebfontsListSort
instance FromHttpApiData WebfontsListSort where
parseQueryParam = \case
"alpha" -> Right Alpha
"date" -> Right Date
"popularity" -> Right Popularity
"style" -> Right Style
"trending" -> Right Trending
x -> Left ("Unable to parse WebfontsListSort from: " <> x)
instance ToHttpApiData WebfontsListSort where
toQueryParam = \case
Alpha -> "alpha"
Date -> "date"
Popularity -> "popularity"
Style -> "style"
Trending -> "trending"
instance FromJSON WebfontsListSort where
parseJSON = parseJSONText "WebfontsListSort"
instance ToJSON WebfontsListSort where
toJSON = toJSONText