module Network.Google.FreebaseSearch.Types.Sum where
import Network.Google.Prelude
data FreebaseSearchFormat
= AC
| Classic
| Entity
| Guids
| Ids
| Mids
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FreebaseSearchFormat
instance FromHttpApiData FreebaseSearchFormat where
parseQueryParam = \case
"ac" -> Right AC
"classic" -> Right Classic
"entity" -> Right Entity
"guids" -> Right Guids
"ids" -> Right Ids
"mids" -> Right Mids
x -> Left ("Unable to parse FreebaseSearchFormat from: " <> x)
instance ToHttpApiData FreebaseSearchFormat where
toQueryParam = \case
AC -> "ac"
Classic -> "classic"
Entity -> "entity"
Guids -> "guids"
Ids -> "ids"
Mids -> "mids"
instance FromJSON FreebaseSearchFormat where
parseJSON = parseJSONText "FreebaseSearchFormat"
instance ToJSON FreebaseSearchFormat where
toJSON = toJSONText
data FreebaseSearchScoring
= FSSEntity
| FSSFreebase
| FSSSchema
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FreebaseSearchScoring
instance FromHttpApiData FreebaseSearchScoring where
parseQueryParam = \case
"entity" -> Right FSSEntity
"freebase" -> Right FSSFreebase
"schema" -> Right FSSSchema
x -> Left ("Unable to parse FreebaseSearchScoring from: " <> x)
instance ToHttpApiData FreebaseSearchScoring where
toQueryParam = \case
FSSEntity -> "entity"
FSSFreebase -> "freebase"
FSSSchema -> "schema"
instance FromJSON FreebaseSearchScoring where
parseJSON = parseJSONText "FreebaseSearchScoring"
instance ToJSON FreebaseSearchScoring where
toJSON = toJSONText
data FreebaseSearchEncode
= HTML
| Off
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FreebaseSearchEncode
instance FromHttpApiData FreebaseSearchEncode where
parseQueryParam = \case
"html" -> Right HTML
"off" -> Right Off
x -> Left ("Unable to parse FreebaseSearchEncode from: " <> x)
instance ToHttpApiData FreebaseSearchEncode where
toQueryParam = \case
HTML -> "html"
Off -> "off"
instance FromJSON FreebaseSearchEncode where
parseJSON = parseJSONText "FreebaseSearchEncode"
instance ToJSON FreebaseSearchEncode where
toJSON = toJSONText
data FreebaseSearchHelp
= Langs
| MAppings
| Predicates
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FreebaseSearchHelp
instance FromHttpApiData FreebaseSearchHelp where
parseQueryParam = \case
"langs" -> Right Langs
"mappings" -> Right MAppings
"predicates" -> Right Predicates
x -> Left ("Unable to parse FreebaseSearchHelp from: " <> x)
instance ToHttpApiData FreebaseSearchHelp where
toQueryParam = \case
Langs -> "langs"
MAppings -> "mappings"
Predicates -> "predicates"
instance FromJSON FreebaseSearchHelp where
parseJSON = parseJSONText "FreebaseSearchHelp"
instance ToJSON FreebaseSearchHelp where
toJSON = toJSONText
data FreebaseSearchSpell
= Always
| NoResults
| NoSpelling
deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
instance Hashable FreebaseSearchSpell
instance FromHttpApiData FreebaseSearchSpell where
parseQueryParam = \case
"always" -> Right Always
"no_results" -> Right NoResults
"no_spelling" -> Right NoSpelling
x -> Left ("Unable to parse FreebaseSearchSpell from: " <> x)
instance ToHttpApiData FreebaseSearchSpell where
toQueryParam = \case
Always -> "always"
NoResults -> "no_results"
NoSpelling -> "no_spelling"
instance FromJSON FreebaseSearchSpell where
parseJSON = parseJSONText "FreebaseSearchSpell"
instance ToJSON FreebaseSearchSpell where
toJSON = toJSONText