{-# LANGUAGE DeriveGeneric #-} module Model.MatrixErrorResponse (MatrixErrorResponse (..)) where import Data.Aeson import GHC.Generics (Generic) import Data.Text (Text) ---------------------------------------------------------------------------------------------------- data MatrixErrorResponse = MatrixErrorResponse { error_code :: Text -- TODO: Enum? , error :: Text } deriving (Eq, Show, Generic) instance ToJSON MatrixErrorResponse where toJSON = genericToJSON defaultOptions { fieldLabelModifier = \name -> case name of "error_code" -> "errcode" other -> other }