{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Network.Ipfs.Api.Key where
import Control.Monad.IO.Class (MonadIO)
import Data.Text (Text)
import Network.Ipfs.Api.Internal (_keyGen, _keyList, _keyRename,
_keyRm)
import Network.Ipfs.Api.Internal.Call (call)
import Network.Ipfs.Api.Types (KeyDetailsObj, KeyObj,
KeyRenameObj)
import Network.Ipfs.Client (IpfsT)
list :: MonadIO m => IpfsT m KeyObj
list :: IpfsT m KeyObj
list = ClientM KeyObj -> IpfsT m KeyObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call ClientM KeyObj
_keyList
gen :: MonadIO m => Text -> Text -> IpfsT m KeyDetailsObj
gen :: Text -> Text -> IpfsT m KeyDetailsObj
gen Text
name = ClientM KeyDetailsObj -> IpfsT m KeyDetailsObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM KeyDetailsObj -> IpfsT m KeyDetailsObj)
-> (Text -> ClientM KeyDetailsObj) -> Text -> IpfsT m KeyDetailsObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text -> ClientM KeyDetailsObj
_keyGen Text
name (Maybe Text -> ClientM KeyDetailsObj)
-> (Text -> Maybe Text) -> Text -> ClientM KeyDetailsObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just
rename :: MonadIO m => Text -> Text -> IpfsT m KeyRenameObj
rename :: Text -> Text -> IpfsT m KeyRenameObj
rename Text
was = ClientM KeyRenameObj -> IpfsT m KeyRenameObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM KeyRenameObj -> IpfsT m KeyRenameObj)
-> (Text -> ClientM KeyRenameObj) -> Text -> IpfsT m KeyRenameObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text -> ClientM KeyRenameObj
_keyRename Text
was (Maybe Text -> ClientM KeyRenameObj)
-> (Text -> Maybe Text) -> Text -> ClientM KeyRenameObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just
rm :: MonadIO m => Text -> IpfsT m KeyObj
rm :: Text -> IpfsT m KeyObj
rm = ClientM KeyObj -> IpfsT m KeyObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM KeyObj -> IpfsT m KeyObj)
-> (Text -> ClientM KeyObj) -> Text -> IpfsT m KeyObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> ClientM KeyObj
_keyRm