module Blockfrost.Types.IPFS
( IPFSAdd (..)
, IPFSPinChange (..)
, IPFSPin (..)
, PinState (..)
, IPFSData (..)
) where
import Blockfrost.Types.Shared
import Data.Aeson
import Data.ByteString.Lazy (ByteString)
import Data.Text (Text)
import Deriving.Aeson
import Servant.API
import Servant.Docs (ToSample (..), singleSample)
data IPFSAdd = IPFSAdd
{ IPFSAdd -> Text
_ipfsAddName :: Text
, IPFSAdd -> Text
_ipfsAddIpfsHash :: Text
, IPFSAdd -> Quantity
_ipfsAddSize :: Quantity
}
deriving stock (Int -> IPFSAdd -> ShowS
[IPFSAdd] -> ShowS
IPFSAdd -> String
(Int -> IPFSAdd -> ShowS)
-> (IPFSAdd -> String) -> ([IPFSAdd] -> ShowS) -> Show IPFSAdd
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IPFSAdd -> ShowS
showsPrec :: Int -> IPFSAdd -> ShowS
$cshow :: IPFSAdd -> String
show :: IPFSAdd -> String
$cshowList :: [IPFSAdd] -> ShowS
showList :: [IPFSAdd] -> ShowS
Show, IPFSAdd -> IPFSAdd -> Bool
(IPFSAdd -> IPFSAdd -> Bool)
-> (IPFSAdd -> IPFSAdd -> Bool) -> Eq IPFSAdd
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IPFSAdd -> IPFSAdd -> Bool
== :: IPFSAdd -> IPFSAdd -> Bool
$c/= :: IPFSAdd -> IPFSAdd -> Bool
/= :: IPFSAdd -> IPFSAdd -> Bool
Eq, (forall x. IPFSAdd -> Rep IPFSAdd x)
-> (forall x. Rep IPFSAdd x -> IPFSAdd) -> Generic IPFSAdd
forall x. Rep IPFSAdd x -> IPFSAdd
forall x. IPFSAdd -> Rep IPFSAdd x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IPFSAdd -> Rep IPFSAdd x
from :: forall x. IPFSAdd -> Rep IPFSAdd x
$cto :: forall x. Rep IPFSAdd x -> IPFSAdd
to :: forall x. Rep IPFSAdd x -> IPFSAdd
Generic)
deriving (Maybe IPFSAdd
Value -> Parser [IPFSAdd]
Value -> Parser IPFSAdd
(Value -> Parser IPFSAdd)
-> (Value -> Parser [IPFSAdd]) -> Maybe IPFSAdd -> FromJSON IPFSAdd
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser IPFSAdd
parseJSON :: Value -> Parser IPFSAdd
$cparseJSONList :: Value -> Parser [IPFSAdd]
parseJSONList :: Value -> Parser [IPFSAdd]
$comittedField :: Maybe IPFSAdd
omittedField :: Maybe IPFSAdd
FromJSON, [IPFSAdd] -> Value
[IPFSAdd] -> Encoding
IPFSAdd -> Bool
IPFSAdd -> Value
IPFSAdd -> Encoding
(IPFSAdd -> Value)
-> (IPFSAdd -> Encoding)
-> ([IPFSAdd] -> Value)
-> ([IPFSAdd] -> Encoding)
-> (IPFSAdd -> Bool)
-> ToJSON IPFSAdd
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: IPFSAdd -> Value
toJSON :: IPFSAdd -> Value
$ctoEncoding :: IPFSAdd -> Encoding
toEncoding :: IPFSAdd -> Encoding
$ctoJSONList :: [IPFSAdd] -> Value
toJSONList :: [IPFSAdd] -> Value
$ctoEncodingList :: [IPFSAdd] -> Encoding
toEncodingList :: [IPFSAdd] -> Encoding
$comitField :: IPFSAdd -> Bool
omitField :: IPFSAdd -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_ipfsAdd", CamelToSnake]] IPFSAdd
instance ToSample IPFSAdd where
toSamples :: Proxy IPFSAdd -> [(Text, IPFSAdd)]
toSamples = [(Text, IPFSAdd)] -> Proxy IPFSAdd -> [(Text, IPFSAdd)]
forall a. a -> Proxy IPFSAdd -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, IPFSAdd)] -> Proxy IPFSAdd -> [(Text, IPFSAdd)])
-> [(Text, IPFSAdd)] -> Proxy IPFSAdd -> [(Text, IPFSAdd)]
forall a b. (a -> b) -> a -> b
$ IPFSAdd -> [(Text, IPFSAdd)]
forall a. a -> [(Text, a)]
singleSample (IPFSAdd -> [(Text, IPFSAdd)]) -> IPFSAdd -> [(Text, IPFSAdd)]
forall a b. (a -> b) -> a -> b
$
Text -> Text -> Quantity -> IPFSAdd
IPFSAdd
Text
"README.md"
Text
"QmZbHqiCxKEVX7QfijzJTkZiSi3WEVTcvANgNAWzDYgZDr"
Quantity
125297
data PinState = Queued | Pinned | Unpinned | Failed | Gc
deriving (PinState -> PinState -> Bool
(PinState -> PinState -> Bool)
-> (PinState -> PinState -> Bool) -> Eq PinState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PinState -> PinState -> Bool
== :: PinState -> PinState -> Bool
$c/= :: PinState -> PinState -> Bool
/= :: PinState -> PinState -> Bool
Eq, Int -> PinState -> ShowS
[PinState] -> ShowS
PinState -> String
(Int -> PinState -> ShowS)
-> (PinState -> String) -> ([PinState] -> ShowS) -> Show PinState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PinState -> ShowS
showsPrec :: Int -> PinState -> ShowS
$cshow :: PinState -> String
show :: PinState -> String
$cshowList :: [PinState] -> ShowS
showList :: [PinState] -> ShowS
Show, Eq PinState
Eq PinState =>
(PinState -> PinState -> Ordering)
-> (PinState -> PinState -> Bool)
-> (PinState -> PinState -> Bool)
-> (PinState -> PinState -> Bool)
-> (PinState -> PinState -> Bool)
-> (PinState -> PinState -> PinState)
-> (PinState -> PinState -> PinState)
-> Ord PinState
PinState -> PinState -> Bool
PinState -> PinState -> Ordering
PinState -> PinState -> PinState
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PinState -> PinState -> Ordering
compare :: PinState -> PinState -> Ordering
$c< :: PinState -> PinState -> Bool
< :: PinState -> PinState -> Bool
$c<= :: PinState -> PinState -> Bool
<= :: PinState -> PinState -> Bool
$c> :: PinState -> PinState -> Bool
> :: PinState -> PinState -> Bool
$c>= :: PinState -> PinState -> Bool
>= :: PinState -> PinState -> Bool
$cmax :: PinState -> PinState -> PinState
max :: PinState -> PinState -> PinState
$cmin :: PinState -> PinState -> PinState
min :: PinState -> PinState -> PinState
Ord, (forall x. PinState -> Rep PinState x)
-> (forall x. Rep PinState x -> PinState) -> Generic PinState
forall x. Rep PinState x -> PinState
forall x. PinState -> Rep PinState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PinState -> Rep PinState x
from :: forall x. PinState -> Rep PinState x
$cto :: forall x. Rep PinState x -> PinState
to :: forall x. Rep PinState x -> PinState
Generic)
deriving (Maybe PinState
Value -> Parser [PinState]
Value -> Parser PinState
(Value -> Parser PinState)
-> (Value -> Parser [PinState])
-> Maybe PinState
-> FromJSON PinState
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser PinState
parseJSON :: Value -> Parser PinState
$cparseJSONList :: Value -> Parser [PinState]
parseJSONList :: Value -> Parser [PinState]
$comittedField :: Maybe PinState
omittedField :: Maybe PinState
FromJSON, [PinState] -> Value
[PinState] -> Encoding
PinState -> Bool
PinState -> Value
PinState -> Encoding
(PinState -> Value)
-> (PinState -> Encoding)
-> ([PinState] -> Value)
-> ([PinState] -> Encoding)
-> (PinState -> Bool)
-> ToJSON PinState
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: PinState -> Value
toJSON :: PinState -> Value
$ctoEncoding :: PinState -> Encoding
toEncoding :: PinState -> Encoding
$ctoJSONList :: [PinState] -> Value
toJSONList :: [PinState] -> Value
$ctoEncodingList :: [PinState] -> Encoding
toEncodingList :: [PinState] -> Encoding
$comitField :: PinState -> Bool
omitField :: PinState -> Bool
ToJSON)
via CustomJSON '[ConstructorTagModifier '[ToLower]] PinState
data IPFSPinChange = IPFSPinChange
{ IPFSPinChange -> Text
_ipfsPinChangeIpfsHash :: Text
, IPFSPinChange -> PinState
_ipfsPinChangeState :: PinState
}
deriving stock (Int -> IPFSPinChange -> ShowS
[IPFSPinChange] -> ShowS
IPFSPinChange -> String
(Int -> IPFSPinChange -> ShowS)
-> (IPFSPinChange -> String)
-> ([IPFSPinChange] -> ShowS)
-> Show IPFSPinChange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IPFSPinChange -> ShowS
showsPrec :: Int -> IPFSPinChange -> ShowS
$cshow :: IPFSPinChange -> String
show :: IPFSPinChange -> String
$cshowList :: [IPFSPinChange] -> ShowS
showList :: [IPFSPinChange] -> ShowS
Show, IPFSPinChange -> IPFSPinChange -> Bool
(IPFSPinChange -> IPFSPinChange -> Bool)
-> (IPFSPinChange -> IPFSPinChange -> Bool) -> Eq IPFSPinChange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IPFSPinChange -> IPFSPinChange -> Bool
== :: IPFSPinChange -> IPFSPinChange -> Bool
$c/= :: IPFSPinChange -> IPFSPinChange -> Bool
/= :: IPFSPinChange -> IPFSPinChange -> Bool
Eq, (forall x. IPFSPinChange -> Rep IPFSPinChange x)
-> (forall x. Rep IPFSPinChange x -> IPFSPinChange)
-> Generic IPFSPinChange
forall x. Rep IPFSPinChange x -> IPFSPinChange
forall x. IPFSPinChange -> Rep IPFSPinChange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IPFSPinChange -> Rep IPFSPinChange x
from :: forall x. IPFSPinChange -> Rep IPFSPinChange x
$cto :: forall x. Rep IPFSPinChange x -> IPFSPinChange
to :: forall x. Rep IPFSPinChange x -> IPFSPinChange
Generic)
deriving (Maybe IPFSPinChange
Value -> Parser [IPFSPinChange]
Value -> Parser IPFSPinChange
(Value -> Parser IPFSPinChange)
-> (Value -> Parser [IPFSPinChange])
-> Maybe IPFSPinChange
-> FromJSON IPFSPinChange
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser IPFSPinChange
parseJSON :: Value -> Parser IPFSPinChange
$cparseJSONList :: Value -> Parser [IPFSPinChange]
parseJSONList :: Value -> Parser [IPFSPinChange]
$comittedField :: Maybe IPFSPinChange
omittedField :: Maybe IPFSPinChange
FromJSON, [IPFSPinChange] -> Value
[IPFSPinChange] -> Encoding
IPFSPinChange -> Bool
IPFSPinChange -> Value
IPFSPinChange -> Encoding
(IPFSPinChange -> Value)
-> (IPFSPinChange -> Encoding)
-> ([IPFSPinChange] -> Value)
-> ([IPFSPinChange] -> Encoding)
-> (IPFSPinChange -> Bool)
-> ToJSON IPFSPinChange
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: IPFSPinChange -> Value
toJSON :: IPFSPinChange -> Value
$ctoEncoding :: IPFSPinChange -> Encoding
toEncoding :: IPFSPinChange -> Encoding
$ctoJSONList :: [IPFSPinChange] -> Value
toJSONList :: [IPFSPinChange] -> Value
$ctoEncodingList :: [IPFSPinChange] -> Encoding
toEncodingList :: [IPFSPinChange] -> Encoding
$comitField :: IPFSPinChange -> Bool
omitField :: IPFSPinChange -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_ipfsPinChange", CamelToSnake]] IPFSPinChange
instance ToSample IPFSPinChange where
toSamples :: Proxy IPFSPinChange -> [(Text, IPFSPinChange)]
toSamples = [(Text, IPFSPinChange)]
-> Proxy IPFSPinChange -> [(Text, IPFSPinChange)]
forall a. a -> Proxy IPFSPinChange -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, IPFSPinChange)]
-> Proxy IPFSPinChange -> [(Text, IPFSPinChange)])
-> [(Text, IPFSPinChange)]
-> Proxy IPFSPinChange
-> [(Text, IPFSPinChange)]
forall a b. (a -> b) -> a -> b
$ IPFSPinChange -> [(Text, IPFSPinChange)]
forall a. a -> [(Text, a)]
singleSample (IPFSPinChange -> [(Text, IPFSPinChange)])
-> IPFSPinChange -> [(Text, IPFSPinChange)]
forall a b. (a -> b) -> a -> b
$
Text -> PinState -> IPFSPinChange
IPFSPinChange
Text
"QmPojRfAXYAXV92Dof7gtSgaVuxEk64xx9CKvprqu9VwA8"
PinState
Queued
data IPFSPin = IPFSPin
{ IPFSPin -> POSIXTime
_ipfsPinTimeCreated :: POSIXTime
, IPFSPin -> POSIXTime
_ipfsPinTimePinned :: POSIXTime
, IPFSPin -> Text
_ipfsPinIpfsHash :: Text
, IPFSPin -> Quantity
_ipfsPinSize :: Quantity
, IPFSPin -> PinState
_ipfsPinState :: PinState
}
deriving stock (Int -> IPFSPin -> ShowS
[IPFSPin] -> ShowS
IPFSPin -> String
(Int -> IPFSPin -> ShowS)
-> (IPFSPin -> String) -> ([IPFSPin] -> ShowS) -> Show IPFSPin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IPFSPin -> ShowS
showsPrec :: Int -> IPFSPin -> ShowS
$cshow :: IPFSPin -> String
show :: IPFSPin -> String
$cshowList :: [IPFSPin] -> ShowS
showList :: [IPFSPin] -> ShowS
Show, IPFSPin -> IPFSPin -> Bool
(IPFSPin -> IPFSPin -> Bool)
-> (IPFSPin -> IPFSPin -> Bool) -> Eq IPFSPin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IPFSPin -> IPFSPin -> Bool
== :: IPFSPin -> IPFSPin -> Bool
$c/= :: IPFSPin -> IPFSPin -> Bool
/= :: IPFSPin -> IPFSPin -> Bool
Eq, (forall x. IPFSPin -> Rep IPFSPin x)
-> (forall x. Rep IPFSPin x -> IPFSPin) -> Generic IPFSPin
forall x. Rep IPFSPin x -> IPFSPin
forall x. IPFSPin -> Rep IPFSPin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IPFSPin -> Rep IPFSPin x
from :: forall x. IPFSPin -> Rep IPFSPin x
$cto :: forall x. Rep IPFSPin x -> IPFSPin
to :: forall x. Rep IPFSPin x -> IPFSPin
Generic)
deriving (Maybe IPFSPin
Value -> Parser [IPFSPin]
Value -> Parser IPFSPin
(Value -> Parser IPFSPin)
-> (Value -> Parser [IPFSPin]) -> Maybe IPFSPin -> FromJSON IPFSPin
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser IPFSPin
parseJSON :: Value -> Parser IPFSPin
$cparseJSONList :: Value -> Parser [IPFSPin]
parseJSONList :: Value -> Parser [IPFSPin]
$comittedField :: Maybe IPFSPin
omittedField :: Maybe IPFSPin
FromJSON, [IPFSPin] -> Value
[IPFSPin] -> Encoding
IPFSPin -> Bool
IPFSPin -> Value
IPFSPin -> Encoding
(IPFSPin -> Value)
-> (IPFSPin -> Encoding)
-> ([IPFSPin] -> Value)
-> ([IPFSPin] -> Encoding)
-> (IPFSPin -> Bool)
-> ToJSON IPFSPin
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: IPFSPin -> Value
toJSON :: IPFSPin -> Value
$ctoEncoding :: IPFSPin -> Encoding
toEncoding :: IPFSPin -> Encoding
$ctoJSONList :: [IPFSPin] -> Value
toJSONList :: [IPFSPin] -> Value
$ctoEncodingList :: [IPFSPin] -> Encoding
toEncodingList :: [IPFSPin] -> Encoding
$comitField :: IPFSPin -> Bool
omitField :: IPFSPin -> Bool
ToJSON)
via CustomJSON '[FieldLabelModifier '[StripPrefix "_ipfsPin", CamelToSnake]] IPFSPin
instance ToSample IPFSPin where
toSamples :: Proxy IPFSPin -> [(Text, IPFSPin)]
toSamples = [(Text, IPFSPin)] -> Proxy IPFSPin -> [(Text, IPFSPin)]
forall a. a -> Proxy IPFSPin -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, IPFSPin)] -> Proxy IPFSPin -> [(Text, IPFSPin)])
-> [(Text, IPFSPin)] -> Proxy IPFSPin -> [(Text, IPFSPin)]
forall a b. (a -> b) -> a -> b
$ IPFSPin -> [(Text, IPFSPin)]
forall a. a -> [(Text, a)]
singleSample (IPFSPin -> [(Text, IPFSPin)]) -> IPFSPin -> [(Text, IPFSPin)]
forall a b. (a -> b) -> a -> b
$
IPFSPin
{ $sel:_ipfsPinTimeCreated:IPFSPin :: POSIXTime
_ipfsPinTimeCreated = POSIXTime
1615551024
, $sel:_ipfsPinTimePinned:IPFSPin :: POSIXTime
_ipfsPinTimePinned = POSIXTime
1615551024
, $sel:_ipfsPinIpfsHash:IPFSPin :: Text
_ipfsPinIpfsHash = Text
"QmdVMnULrY95mth2XkwjxDtMHvzuzmvUPTotKE1tgqKbCx"
, $sel:_ipfsPinSize:IPFSPin :: Quantity
_ipfsPinSize = Quantity
1615551024
, $sel:_ipfsPinState:IPFSPin :: PinState
_ipfsPinState = PinState
Pinned
}
newtype IPFSData = IPFSData ByteString
deriving (Int -> IPFSData -> ShowS
[IPFSData] -> ShowS
IPFSData -> String
(Int -> IPFSData -> ShowS)
-> (IPFSData -> String) -> ([IPFSData] -> ShowS) -> Show IPFSData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IPFSData -> ShowS
showsPrec :: Int -> IPFSData -> ShowS
$cshow :: IPFSData -> String
show :: IPFSData -> String
$cshowList :: [IPFSData] -> ShowS
showList :: [IPFSData] -> ShowS
Show, IPFSData -> IPFSData -> Bool
(IPFSData -> IPFSData -> Bool)
-> (IPFSData -> IPFSData -> Bool) -> Eq IPFSData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IPFSData -> IPFSData -> Bool
== :: IPFSData -> IPFSData -> Bool
$c/= :: IPFSData -> IPFSData -> Bool
/= :: IPFSData -> IPFSData -> Bool
Eq, (forall x. IPFSData -> Rep IPFSData x)
-> (forall x. Rep IPFSData x -> IPFSData) -> Generic IPFSData
forall x. Rep IPFSData x -> IPFSData
forall x. IPFSData -> Rep IPFSData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IPFSData -> Rep IPFSData x
from :: forall x. IPFSData -> Rep IPFSData x
$cto :: forall x. Rep IPFSData x -> IPFSData
to :: forall x. Rep IPFSData x -> IPFSData
Generic)
instance ToSample IPFSData where
toSamples :: Proxy IPFSData -> [(Text, IPFSData)]
toSamples = [(Text, IPFSData)] -> Proxy IPFSData -> [(Text, IPFSData)]
forall a. a -> Proxy IPFSData -> a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([(Text, IPFSData)] -> Proxy IPFSData -> [(Text, IPFSData)])
-> [(Text, IPFSData)] -> Proxy IPFSData -> [(Text, IPFSData)]
forall a b. (a -> b) -> a -> b
$ IPFSData -> [(Text, IPFSData)]
forall a. a -> [(Text, a)]
singleSample (IPFSData -> [(Text, IPFSData)]) -> IPFSData -> [(Text, IPFSData)]
forall a b. (a -> b) -> a -> b
$ ByteString -> IPFSData
IPFSData ByteString
"sample ipfs bytestring"
instance MimeRender OctetStream IPFSData where
mimeRender :: Proxy OctetStream -> IPFSData -> ByteString
mimeRender Proxy OctetStream
_ (IPFSData ByteString
cs) = ByteString
cs
instance MimeUnrender OctetStream IPFSData where
mimeUnrender :: Proxy OctetStream -> ByteString -> Either String IPFSData
mimeUnrender Proxy OctetStream
_ ByteString
lbs = IPFSData -> Either String IPFSData
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IPFSData -> Either String IPFSData)
-> IPFSData -> Either String IPFSData
forall a b. (a -> b) -> a -> b
$ ByteString -> IPFSData
IPFSData ByteString
lbs
instance MimeRender PlainText IPFSData where
mimeRender :: Proxy PlainText -> IPFSData -> ByteString
mimeRender Proxy PlainText
_ (IPFSData ByteString
cs) = ByteString
cs
instance MimeUnrender PlainText IPFSData where
mimeUnrender :: Proxy PlainText -> ByteString -> Either String IPFSData
mimeUnrender Proxy PlainText
_ ByteString
lbs = IPFSData -> Either String IPFSData
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (IPFSData -> Either String IPFSData)
-> IPFSData -> Either String IPFSData
forall a b. (a -> b) -> a -> b
$ ByteString -> IPFSData
IPFSData ByteString
lbs