{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Represents a rebase operation.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Ggit.Structs.RebaseOperation
    ( 

-- * Exported types
    RebaseOperation(..)                     ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [ref]("GI.Ggit.Structs.RebaseOperation#g:method:ref"), [unref]("GI.Ggit.Structs.RebaseOperation#g:method:unref").
-- 
-- ==== Getters
-- [getExec]("GI.Ggit.Structs.RebaseOperation#g:method:getExec"), [getId]("GI.Ggit.Structs.RebaseOperation#g:method:getId"), [getOperationType]("GI.Ggit.Structs.RebaseOperation#g:method:getOperationType").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveRebaseOperationMethod            ,
#endif

-- ** getExec #method:getExec#

#if defined(ENABLE_OVERLOADING)
    RebaseOperationGetExecMethodInfo        ,
#endif
    rebaseOperationGetExec                  ,


-- ** getId #method:getId#

#if defined(ENABLE_OVERLOADING)
    RebaseOperationGetIdMethodInfo          ,
#endif
    rebaseOperationGetId                    ,


-- ** getOperationType #method:getOperationType#

#if defined(ENABLE_OVERLOADING)
    RebaseOperationGetOperationTypeMethodInfo,
#endif
    rebaseOperationGetOperationType         ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    RebaseOperationRefMethodInfo            ,
#endif
    rebaseOperationRef                      ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    RebaseOperationUnrefMethodInfo          ,
#endif
    rebaseOperationUnref                    ,




    ) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 qualified GHC.Records as R

import {-# SOURCE #-} qualified GI.Ggit.Enums as Ggit.Enums
import {-# SOURCE #-} qualified GI.Ggit.Structs.OId as Ggit.OId

-- | Memory-managed wrapper type.
newtype RebaseOperation = RebaseOperation (SP.ManagedPtr RebaseOperation)
    deriving (RebaseOperation -> RebaseOperation -> Bool
(RebaseOperation -> RebaseOperation -> Bool)
-> (RebaseOperation -> RebaseOperation -> Bool)
-> Eq RebaseOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RebaseOperation -> RebaseOperation -> Bool
== :: RebaseOperation -> RebaseOperation -> Bool
$c/= :: RebaseOperation -> RebaseOperation -> Bool
/= :: RebaseOperation -> RebaseOperation -> Bool
Eq)

instance SP.ManagedPtrNewtype RebaseOperation where
    toManagedPtr :: RebaseOperation -> ManagedPtr RebaseOperation
toManagedPtr (RebaseOperation ManagedPtr RebaseOperation
p) = ManagedPtr RebaseOperation
p

foreign import ccall "ggit_rebase_operation_get_type" c_ggit_rebase_operation_get_type :: 
    IO GType

type instance O.ParentTypes RebaseOperation = '[]
instance O.HasParentTypes RebaseOperation

instance B.Types.TypedObject RebaseOperation where
    glibType :: IO GType
glibType = IO GType
c_ggit_rebase_operation_get_type

instance B.Types.GBoxed RebaseOperation

-- | Convert 'RebaseOperation' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe RebaseOperation) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ggit_rebase_operation_get_type
    gvalueSet_ :: Ptr GValue -> Maybe RebaseOperation -> IO ()
gvalueSet_ Ptr GValue
gv Maybe RebaseOperation
P.Nothing = Ptr GValue -> Ptr RebaseOperation -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr RebaseOperation
forall a. Ptr a
FP.nullPtr :: FP.Ptr RebaseOperation)
    gvalueSet_ Ptr GValue
gv (P.Just RebaseOperation
obj) = RebaseOperation -> (Ptr RebaseOperation -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RebaseOperation
obj (Ptr GValue -> Ptr RebaseOperation -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe RebaseOperation)
gvalueGet_ Ptr GValue
gv = do
        Ptr RebaseOperation
ptr <- Ptr GValue -> IO (Ptr RebaseOperation)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr RebaseOperation)
        if Ptr RebaseOperation
ptr Ptr RebaseOperation -> Ptr RebaseOperation -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr RebaseOperation
forall a. Ptr a
FP.nullPtr
        then RebaseOperation -> Maybe RebaseOperation
forall a. a -> Maybe a
P.Just (RebaseOperation -> Maybe RebaseOperation)
-> IO RebaseOperation -> IO (Maybe RebaseOperation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr RebaseOperation -> RebaseOperation)
-> Ptr RebaseOperation -> IO RebaseOperation
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr RebaseOperation -> RebaseOperation
RebaseOperation Ptr RebaseOperation
ptr
        else Maybe RebaseOperation -> IO (Maybe RebaseOperation)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RebaseOperation
forall a. Maybe a
P.Nothing
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RebaseOperation
type instance O.AttributeList RebaseOperation = RebaseOperationAttributeList
type RebaseOperationAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

-- method RebaseOperation::get_exec
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_operation"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOperation" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOperation."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ggit_rebase_operation_get_exec" ggit_rebase_operation_get_exec :: 
    Ptr RebaseOperation ->                  -- rebase_operation : TInterface (Name {namespace = "Ggit", name = "RebaseOperation"})
    IO CString

-- | Gets the executable the user has requested be run.  This will only
-- be populated for operations of type /@gGITREBASEOPERATIONEXEC@/.
rebaseOperationGetExec ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOperation
    -- ^ /@rebaseOperation@/: a t'GI.Ggit.Structs.RebaseOperation.RebaseOperation'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the executable the user has requested be run or 'P.Nothing'.
rebaseOperationGetExec :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RebaseOperation -> m (Maybe Text)
rebaseOperationGetExec RebaseOperation
rebaseOperation = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
    CString
result <- Ptr RebaseOperation -> IO CString
ggit_rebase_operation_get_exec Ptr RebaseOperation
rebaseOperation'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
    Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data RebaseOperationGetExecMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod RebaseOperationGetExecMethodInfo RebaseOperation signature where
    overloadedMethod = rebaseOperationGetExec

instance O.OverloadedMethodInfo RebaseOperationGetExecMethodInfo RebaseOperation where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Ggit.Structs.RebaseOperation.rebaseOperationGetExec",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.14/docs/GI-Ggit-Structs-RebaseOperation.html#v:rebaseOperationGetExec"
        })


#endif

-- method RebaseOperation::get_id
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_operation"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOperation" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOperation."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Ggit" , name = "OId" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_rebase_operation_get_id" ggit_rebase_operation_get_id :: 
    Ptr RebaseOperation ->                  -- rebase_operation : TInterface (Name {namespace = "Ggit", name = "RebaseOperation"})
    IO (Ptr Ggit.OId.OId)

-- | Gets the commit ID being cherry-picked. This will be populated for
-- all operations except those of type /@gGITREBASEOPERATIONEXEC@/.
rebaseOperationGetId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOperation
    -- ^ /@rebaseOperation@/: a t'GI.Ggit.Structs.RebaseOperation.RebaseOperation'.
    -> m (Maybe Ggit.OId.OId)
    -- ^ __Returns:__ the commit ID being cherry-picked or 'P.Nothing'.
rebaseOperationGetId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RebaseOperation -> m (Maybe OId)
rebaseOperationGetId RebaseOperation
rebaseOperation = IO (Maybe OId) -> m (Maybe OId)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe OId) -> m (Maybe OId))
-> IO (Maybe OId) -> m (Maybe OId)
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
    Ptr OId
result <- Ptr RebaseOperation -> IO (Ptr OId)
ggit_rebase_operation_get_id Ptr RebaseOperation
rebaseOperation'
    Maybe OId
maybeResult <- Ptr OId -> (Ptr OId -> IO OId) -> IO (Maybe OId)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr OId
result ((Ptr OId -> IO OId) -> IO (Maybe OId))
-> (Ptr OId -> IO OId) -> IO (Maybe OId)
forall a b. (a -> b) -> a -> b
$ \Ptr OId
result' -> do
        OId
result'' <- ((ManagedPtr OId -> OId) -> Ptr OId -> IO OId
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr OId -> OId
Ggit.OId.OId) Ptr OId
result'
        OId -> IO OId
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return OId
result''
    RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
    Maybe OId -> IO (Maybe OId)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe OId
maybeResult

#if defined(ENABLE_OVERLOADING)
data RebaseOperationGetIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.OverloadedMethod RebaseOperationGetIdMethodInfo RebaseOperation signature where
    overloadedMethod = rebaseOperationGetId

instance O.OverloadedMethodInfo RebaseOperationGetIdMethodInfo RebaseOperation where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Ggit.Structs.RebaseOperation.rebaseOperationGetId",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.14/docs/GI-Ggit-Structs-RebaseOperation.html#v:rebaseOperationGetId"
        })


#endif

-- method RebaseOperation::get_operation_type
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_operation"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOperation" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOperation."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Ggit" , name = "RebaseOperationType" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_rebase_operation_get_operation_type" ggit_rebase_operation_get_operation_type :: 
    Ptr RebaseOperation ->                  -- rebase_operation : TInterface (Name {namespace = "Ggit", name = "RebaseOperation"})
    IO CUInt

-- | Gets the type of rebase operation.
rebaseOperationGetOperationType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOperation
    -- ^ /@rebaseOperation@/: a t'GI.Ggit.Structs.RebaseOperation.RebaseOperation'.
    -> m Ggit.Enums.RebaseOperationType
    -- ^ __Returns:__ a t'GI.Ggit.Enums.RebaseOperationType'.
rebaseOperationGetOperationType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RebaseOperation -> m RebaseOperationType
rebaseOperationGetOperationType RebaseOperation
rebaseOperation = IO RebaseOperationType -> m RebaseOperationType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RebaseOperationType -> m RebaseOperationType)
-> IO RebaseOperationType -> m RebaseOperationType
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
    CUInt
result <- Ptr RebaseOperation -> IO CUInt
ggit_rebase_operation_get_operation_type Ptr RebaseOperation
rebaseOperation'
    let result' :: RebaseOperationType
result' = (Int -> RebaseOperationType
forall a. Enum a => Int -> a
toEnum (Int -> RebaseOperationType)
-> (CUInt -> Int) -> CUInt -> RebaseOperationType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
    RebaseOperationType -> IO RebaseOperationType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return RebaseOperationType
result'

#if defined(ENABLE_OVERLOADING)
data RebaseOperationGetOperationTypeMethodInfo
instance (signature ~ (m Ggit.Enums.RebaseOperationType), MonadIO m) => O.OverloadedMethod RebaseOperationGetOperationTypeMethodInfo RebaseOperation signature where
    overloadedMethod = rebaseOperationGetOperationType

instance O.OverloadedMethodInfo RebaseOperationGetOperationTypeMethodInfo RebaseOperation where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Ggit.Structs.RebaseOperation.rebaseOperationGetOperationType",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.14/docs/GI-Ggit-Structs-RebaseOperation.html#v:rebaseOperationGetOperationType"
        })


#endif

-- method RebaseOperation::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_operation"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOperation" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOperation."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Ggit" , name = "RebaseOperation" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_rebase_operation_ref" ggit_rebase_operation_ref :: 
    Ptr RebaseOperation ->                  -- rebase_operation : TInterface (Name {namespace = "Ggit", name = "RebaseOperation"})
    IO (Ptr RebaseOperation)

-- | Atomically increments the reference count of /@rebaseOperation@/ by one.
-- This function is MT-safe and may be called from any thread.
rebaseOperationRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOperation
    -- ^ /@rebaseOperation@/: a t'GI.Ggit.Structs.RebaseOperation.RebaseOperation'.
    -> m (Maybe RebaseOperation)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Structs.RebaseOperation.RebaseOperation' or 'P.Nothing'.
rebaseOperationRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RebaseOperation -> m (Maybe RebaseOperation)
rebaseOperationRef RebaseOperation
rebaseOperation = IO (Maybe RebaseOperation) -> m (Maybe RebaseOperation)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe RebaseOperation) -> m (Maybe RebaseOperation))
-> IO (Maybe RebaseOperation) -> m (Maybe RebaseOperation)
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
    Ptr RebaseOperation
result <- Ptr RebaseOperation -> IO (Ptr RebaseOperation)
ggit_rebase_operation_ref Ptr RebaseOperation
rebaseOperation'
    Maybe RebaseOperation
maybeResult <- Ptr RebaseOperation
-> (Ptr RebaseOperation -> IO RebaseOperation)
-> IO (Maybe RebaseOperation)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr RebaseOperation
result ((Ptr RebaseOperation -> IO RebaseOperation)
 -> IO (Maybe RebaseOperation))
-> (Ptr RebaseOperation -> IO RebaseOperation)
-> IO (Maybe RebaseOperation)
forall a b. (a -> b) -> a -> b
$ \Ptr RebaseOperation
result' -> do
        RebaseOperation
result'' <- ((ManagedPtr RebaseOperation -> RebaseOperation)
-> Ptr RebaseOperation -> IO RebaseOperation
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr RebaseOperation -> RebaseOperation
RebaseOperation) Ptr RebaseOperation
result'
        RebaseOperation -> IO RebaseOperation
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return RebaseOperation
result''
    RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
    Maybe RebaseOperation -> IO (Maybe RebaseOperation)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RebaseOperation
maybeResult

#if defined(ENABLE_OVERLOADING)
data RebaseOperationRefMethodInfo
instance (signature ~ (m (Maybe RebaseOperation)), MonadIO m) => O.OverloadedMethod RebaseOperationRefMethodInfo RebaseOperation signature where
    overloadedMethod = rebaseOperationRef

instance O.OverloadedMethodInfo RebaseOperationRefMethodInfo RebaseOperation where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Ggit.Structs.RebaseOperation.rebaseOperationRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.14/docs/GI-Ggit-Structs-RebaseOperation.html#v:rebaseOperationRef"
        })


#endif

-- method RebaseOperation::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_operation"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOperation" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOperation."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ggit_rebase_operation_unref" ggit_rebase_operation_unref :: 
    Ptr RebaseOperation ->                  -- rebase_operation : TInterface (Name {namespace = "Ggit", name = "RebaseOperation"})
    IO ()

-- | Atomically decrements the reference count of /@rebaseOperation@/ by one.
-- If the reference count drops to 0, /@rebaseOperation@/ is freed.
rebaseOperationUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOperation
    -- ^ /@rebaseOperation@/: a t'GI.Ggit.Structs.RebaseOperation.RebaseOperation'.
    -> m ()
rebaseOperationUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RebaseOperation -> m ()
rebaseOperationUnref RebaseOperation
rebaseOperation = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOperation
rebaseOperation' <- RebaseOperation -> IO (Ptr RebaseOperation)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOperation
rebaseOperation
    Ptr RebaseOperation -> IO ()
ggit_rebase_operation_unref Ptr RebaseOperation
rebaseOperation'
    RebaseOperation -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOperation
rebaseOperation
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RebaseOperationUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod RebaseOperationUnrefMethodInfo RebaseOperation signature where
    overloadedMethod = rebaseOperationUnref

instance O.OverloadedMethodInfo RebaseOperationUnrefMethodInfo RebaseOperation where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Ggit.Structs.RebaseOperation.rebaseOperationUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ggit-1.0.14/docs/GI-Ggit-Structs-RebaseOperation.html#v:rebaseOperationUnref"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveRebaseOperationMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveRebaseOperationMethod "ref" o = RebaseOperationRefMethodInfo
    ResolveRebaseOperationMethod "unref" o = RebaseOperationUnrefMethodInfo
    ResolveRebaseOperationMethod "getExec" o = RebaseOperationGetExecMethodInfo
    ResolveRebaseOperationMethod "getId" o = RebaseOperationGetIdMethodInfo
    ResolveRebaseOperationMethod "getOperationType" o = RebaseOperationGetOperationTypeMethodInfo
    ResolveRebaseOperationMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveRebaseOperationMethod t RebaseOperation, O.OverloadedMethod info RebaseOperation p) => OL.IsLabel t (RebaseOperation -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveRebaseOperationMethod t RebaseOperation, O.OverloadedMethod info RebaseOperation p, R.HasField t RebaseOperation p) => R.HasField t RebaseOperation p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveRebaseOperationMethod t RebaseOperation, O.OverloadedMethodInfo info RebaseOperation) => OL.IsLabel t (O.MethodProxy info RebaseOperation) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif