module Network.IPFS.Client.Error.Types (ErrorBody (..)) where

import Network.IPFS.Prelude

data ErrorBody = ErrorBody {ErrorBody -> String
message :: String}

instance FromJSON ErrorBody where
  parseJSON :: Value -> Parser ErrorBody
parseJSON = String -> (Object -> Parser ErrorBody) -> Value -> Parser ErrorBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"ErrorBody" \Object
obj -> do
    String
message    <- Object
obj Object -> Text -> Parser String
forall a. FromJSON a => Object -> Text -> Parser a
.: Text
"Message"
    return ErrorBody :: String -> ErrorBody
ErrorBody {String
message :: String
$sel:message:ErrorBody :: String
..}