{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Ggit.Structs.ReflogEntry
(
ReflogEntry(..) ,
noReflogEntry ,
#if defined(ENABLE_OVERLOADING)
ResolveReflogEntryMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ReflogEntryGetCommitterMethodInfo ,
#endif
reflogEntryGetCommitter ,
#if defined(ENABLE_OVERLOADING)
ReflogEntryGetMessageMethodInfo ,
#endif
reflogEntryGetMessage ,
#if defined(ENABLE_OVERLOADING)
ReflogEntryGetNewIdMethodInfo ,
#endif
reflogEntryGetNewId ,
#if defined(ENABLE_OVERLOADING)
ReflogEntryGetOldIdMethodInfo ,
#endif
reflogEntryGetOldId ,
#if defined(ENABLE_OVERLOADING)
ReflogEntryRefMethodInfo ,
#endif
reflogEntryRef ,
#if defined(ENABLE_OVERLOADING)
ReflogEntryUnrefMethodInfo ,
#endif
reflogEntryUnref ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.Ggit.Objects.Signature as Ggit.Signature
import {-# SOURCE #-} qualified GI.Ggit.Structs.OId as Ggit.OId
newtype ReflogEntry = ReflogEntry (ManagedPtr ReflogEntry)
deriving (Eq)
foreign import ccall "ggit_reflog_entry_get_type" c_ggit_reflog_entry_get_type ::
IO GType
instance BoxedObject ReflogEntry where
boxedType _ = c_ggit_reflog_entry_get_type
instance B.GValue.IsGValue ReflogEntry where
toGValue o = do
gtype <- c_ggit_reflog_entry_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_boxed)
fromGValue gv = do
ptr <- B.GValue.get_boxed gv :: IO (Ptr ReflogEntry)
B.ManagedPtr.newBoxed ReflogEntry ptr
noReflogEntry :: Maybe ReflogEntry
noReflogEntry = Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ReflogEntry
type instance O.AttributeList ReflogEntry = ReflogEntryAttributeList
type ReflogEntryAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_reflog_entry_get_committer" ggit_reflog_entry_get_committer ::
Ptr ReflogEntry ->
IO (Ptr Ggit.Signature.Signature)
reflogEntryGetCommitter ::
(B.CallStack.HasCallStack, MonadIO m) =>
ReflogEntry
-> m (Maybe Ggit.Signature.Signature)
reflogEntryGetCommitter reflogEntry = liftIO $ do
reflogEntry' <- unsafeManagedPtrGetPtr reflogEntry
result <- ggit_reflog_entry_get_committer reflogEntry'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Ggit.Signature.Signature) result'
return result''
touchManagedPtr reflogEntry
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ReflogEntryGetCommitterMethodInfo
instance (signature ~ (m (Maybe Ggit.Signature.Signature)), MonadIO m) => O.MethodInfo ReflogEntryGetCommitterMethodInfo ReflogEntry signature where
overloadedMethod = reflogEntryGetCommitter
#endif
foreign import ccall "ggit_reflog_entry_get_message" ggit_reflog_entry_get_message ::
Ptr ReflogEntry ->
IO CString
reflogEntryGetMessage ::
(B.CallStack.HasCallStack, MonadIO m) =>
ReflogEntry
-> m (Maybe T.Text)
reflogEntryGetMessage reflogEntry = liftIO $ do
reflogEntry' <- unsafeManagedPtrGetPtr reflogEntry
result <- ggit_reflog_entry_get_message reflogEntry'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr reflogEntry
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ReflogEntryGetMessageMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo ReflogEntryGetMessageMethodInfo ReflogEntry signature where
overloadedMethod = reflogEntryGetMessage
#endif
foreign import ccall "ggit_reflog_entry_get_new_id" ggit_reflog_entry_get_new_id ::
Ptr ReflogEntry ->
IO (Ptr Ggit.OId.OId)
reflogEntryGetNewId ::
(B.CallStack.HasCallStack, MonadIO m) =>
ReflogEntry
-> m (Maybe Ggit.OId.OId)
reflogEntryGetNewId reflogEntry = liftIO $ do
reflogEntry' <- unsafeManagedPtrGetPtr reflogEntry
result <- ggit_reflog_entry_get_new_id reflogEntry'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr reflogEntry
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ReflogEntryGetNewIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.MethodInfo ReflogEntryGetNewIdMethodInfo ReflogEntry signature where
overloadedMethod = reflogEntryGetNewId
#endif
foreign import ccall "ggit_reflog_entry_get_old_id" ggit_reflog_entry_get_old_id ::
Ptr ReflogEntry ->
IO (Ptr Ggit.OId.OId)
reflogEntryGetOldId ::
(B.CallStack.HasCallStack, MonadIO m) =>
ReflogEntry
-> m (Maybe Ggit.OId.OId)
reflogEntryGetOldId reflogEntry = liftIO $ do
reflogEntry' <- unsafeManagedPtrGetPtr reflogEntry
result <- ggit_reflog_entry_get_old_id reflogEntry'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr reflogEntry
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ReflogEntryGetOldIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.MethodInfo ReflogEntryGetOldIdMethodInfo ReflogEntry signature where
overloadedMethod = reflogEntryGetOldId
#endif
foreign import ccall "ggit_reflog_entry_ref" ggit_reflog_entry_ref ::
Ptr ReflogEntry ->
IO (Ptr ReflogEntry)
reflogEntryRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
ReflogEntry
-> m (Maybe ReflogEntry)
reflogEntryRef reflogEntry = liftIO $ do
reflogEntry' <- unsafeManagedPtrGetPtr reflogEntry
result <- ggit_reflog_entry_ref reflogEntry'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newBoxed ReflogEntry) result'
return result''
touchManagedPtr reflogEntry
return maybeResult
#if defined(ENABLE_OVERLOADING)
data ReflogEntryRefMethodInfo
instance (signature ~ (m (Maybe ReflogEntry)), MonadIO m) => O.MethodInfo ReflogEntryRefMethodInfo ReflogEntry signature where
overloadedMethod = reflogEntryRef
#endif
foreign import ccall "ggit_reflog_entry_unref" ggit_reflog_entry_unref ::
Ptr ReflogEntry ->
IO ()
reflogEntryUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
ReflogEntry
-> m ()
reflogEntryUnref reflogEntry = liftIO $ do
reflogEntry' <- unsafeManagedPtrGetPtr reflogEntry
ggit_reflog_entry_unref reflogEntry'
touchManagedPtr reflogEntry
return ()
#if defined(ENABLE_OVERLOADING)
data ReflogEntryUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo ReflogEntryUnrefMethodInfo ReflogEntry signature where
overloadedMethod = reflogEntryUnref
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveReflogEntryMethod (t :: Symbol) (o :: *) :: * where
ResolveReflogEntryMethod "ref" o = ReflogEntryRefMethodInfo
ResolveReflogEntryMethod "unref" o = ReflogEntryUnrefMethodInfo
ResolveReflogEntryMethod "getCommitter" o = ReflogEntryGetCommitterMethodInfo
ResolveReflogEntryMethod "getMessage" o = ReflogEntryGetMessageMethodInfo
ResolveReflogEntryMethod "getNewId" o = ReflogEntryGetNewIdMethodInfo
ResolveReflogEntryMethod "getOldId" o = ReflogEntryGetOldIdMethodInfo
ResolveReflogEntryMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveReflogEntryMethod t ReflogEntry, O.MethodInfo info ReflogEntry p) => OL.IsLabel t (ReflogEntry -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif