{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Represents the options used when rebasing.

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

module GI.Ggit.Structs.RebaseOptions
    ( 

-- * Exported types
    RebaseOptions(..)                       ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveRebaseOptionsMethod              ,
#endif


-- ** copy #method:copy#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsCopyMethodInfo             ,
#endif
    rebaseOptionsCopy                       ,


-- ** free #method:free#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsFreeMethodInfo             ,
#endif
    rebaseOptionsFree                       ,


-- ** getCheckoutOptions #method:getCheckoutOptions#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsGetCheckoutOptionsMethodInfo,
#endif
    rebaseOptionsGetCheckoutOptions         ,


-- ** getQuiet #method:getQuiet#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsGetQuietMethodInfo         ,
#endif
    rebaseOptionsGetQuiet                   ,


-- ** getRewriteNotesRef #method:getRewriteNotesRef#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsGetRewriteNotesRefMethodInfo,
#endif
    rebaseOptionsGetRewriteNotesRef         ,


-- ** new #method:new#

    rebaseOptionsNew                        ,


-- ** setCheckoutOptions #method:setCheckoutOptions#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsSetCheckoutOptionsMethodInfo,
#endif
    rebaseOptionsSetCheckoutOptions         ,


-- ** setQuiet #method:setQuiet#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsSetQuietMethodInfo         ,
#endif
    rebaseOptionsSetQuiet                   ,


-- ** setRewriteNotesRef #method:setRewriteNotesRef#

#if defined(ENABLE_OVERLOADING)
    RebaseOptionsSetRewriteNotesRefMethodInfo,
#endif
    rebaseOptionsSetRewriteNotesRef         ,




    ) 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.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.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.CheckoutOptions as Ggit.CheckoutOptions

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

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

foreign import ccall "ggit_rebase_options_get_type" c_ggit_rebase_options_get_type :: 
    IO GType

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

instance B.Types.TypedObject RebaseOptions where
    glibType :: IO GType
glibType = IO GType
c_ggit_rebase_options_get_type

instance B.Types.GBoxed RebaseOptions

-- | Convert 'RebaseOptions' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue RebaseOptions where
    toGValue :: RebaseOptions -> IO GValue
toGValue o :: RebaseOptions
o = do
        GType
gtype <- IO GType
c_ggit_rebase_options_get_type
        RebaseOptions -> (Ptr RebaseOptions -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RebaseOptions
o (GType
-> (GValue -> Ptr RebaseOptions -> IO ())
-> Ptr RebaseOptions
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr RebaseOptions -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
        
    fromGValue :: GValue -> IO RebaseOptions
fromGValue gv :: GValue
gv = do
        Ptr RebaseOptions
ptr <- GValue -> IO (Ptr RebaseOptions)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr RebaseOptions)
        (ManagedPtr RebaseOptions -> RebaseOptions)
-> Ptr RebaseOptions -> IO RebaseOptions
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr RebaseOptions -> RebaseOptions
RebaseOptions Ptr RebaseOptions
ptr
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RebaseOptions
type instance O.AttributeList RebaseOptions = RebaseOptionsAttributeList
type RebaseOptionsAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method RebaseOptions::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Ggit" , name = "RebaseOptions" })
-- throws : False
-- Skip return : False

foreign import ccall "ggit_rebase_options_new" ggit_rebase_options_new :: 
    IO (Ptr RebaseOptions)

-- | Creates a new t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
rebaseOptionsNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m RebaseOptions
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
rebaseOptionsNew :: m RebaseOptions
rebaseOptionsNew  = IO RebaseOptions -> m RebaseOptions
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RebaseOptions -> m RebaseOptions)
-> IO RebaseOptions -> m RebaseOptions
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
result <- IO (Ptr RebaseOptions)
ggit_rebase_options_new
    Text -> Ptr RebaseOptions -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "rebaseOptionsNew" Ptr RebaseOptions
result
    RebaseOptions
result' <- ((ManagedPtr RebaseOptions -> RebaseOptions)
-> Ptr RebaseOptions -> IO RebaseOptions
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RebaseOptions -> RebaseOptions
RebaseOptions) Ptr RebaseOptions
result
    RebaseOptions -> IO RebaseOptions
forall (m :: * -> *) a. Monad m => a -> m a
return RebaseOptions
result'

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "ggit_rebase_options_copy" ggit_rebase_options_copy :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    IO (Ptr RebaseOptions)

-- | Copies /@rebaseOptions@/ into a newly allocated t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
rebaseOptionsCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    -- ^ /@rebaseOptions@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
    -> m (Maybe RebaseOptions)
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Structs.RebaseOptions.RebaseOptions' or 'P.Nothing'.
rebaseOptionsCopy :: RebaseOptions -> m (Maybe RebaseOptions)
rebaseOptionsCopy rebaseOptions :: RebaseOptions
rebaseOptions = IO (Maybe RebaseOptions) -> m (Maybe RebaseOptions)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe RebaseOptions) -> m (Maybe RebaseOptions))
-> IO (Maybe RebaseOptions) -> m (Maybe RebaseOptions)
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    Ptr RebaseOptions
result <- Ptr RebaseOptions -> IO (Ptr RebaseOptions)
ggit_rebase_options_copy Ptr RebaseOptions
rebaseOptions'
    Maybe RebaseOptions
maybeResult <- Ptr RebaseOptions
-> (Ptr RebaseOptions -> IO RebaseOptions)
-> IO (Maybe RebaseOptions)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr RebaseOptions
result ((Ptr RebaseOptions -> IO RebaseOptions)
 -> IO (Maybe RebaseOptions))
-> (Ptr RebaseOptions -> IO RebaseOptions)
-> IO (Maybe RebaseOptions)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr RebaseOptions
result' -> do
        RebaseOptions
result'' <- ((ManagedPtr RebaseOptions -> RebaseOptions)
-> Ptr RebaseOptions -> IO RebaseOptions
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RebaseOptions -> RebaseOptions
RebaseOptions) Ptr RebaseOptions
result'
        RebaseOptions -> IO RebaseOptions
forall (m :: * -> *) a. Monad m => a -> m a
return RebaseOptions
result''
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    Maybe RebaseOptions -> IO (Maybe RebaseOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RebaseOptions
maybeResult

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsCopyMethodInfo
instance (signature ~ (m (Maybe RebaseOptions)), MonadIO m) => O.MethodInfo RebaseOptionsCopyMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsCopy

#endif

-- method RebaseOptions::free
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOptions."
--                 , 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_options_free" ggit_rebase_options_free :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    IO ()

-- | Frees /@rebaseOptions@/.
rebaseOptionsFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    -- ^ /@rebaseOptions@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
    -> m ()
rebaseOptionsFree :: RebaseOptions -> m ()
rebaseOptionsFree rebaseOptions :: RebaseOptions
rebaseOptions = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    Ptr RebaseOptions -> IO ()
ggit_rebase_options_free Ptr RebaseOptions
rebaseOptions'
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RebaseOptionsFreeMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsFree

#endif

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

foreign import ccall "ggit_rebase_options_get_checkout_options" ggit_rebase_options_get_checkout_options :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    IO (Ptr Ggit.CheckoutOptions.CheckoutOptions)

-- | Get the checkout options object or 'P.Nothing' if not set.
rebaseOptionsGetCheckoutOptions ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    -- ^ /@rebaseOptions@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
    -> m (Maybe Ggit.CheckoutOptions.CheckoutOptions)
    -- ^ __Returns:__ the checkout options or 'P.Nothing'.
rebaseOptionsGetCheckoutOptions :: RebaseOptions -> m (Maybe CheckoutOptions)
rebaseOptionsGetCheckoutOptions rebaseOptions :: RebaseOptions
rebaseOptions = IO (Maybe CheckoutOptions) -> m (Maybe CheckoutOptions)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe CheckoutOptions) -> m (Maybe CheckoutOptions))
-> IO (Maybe CheckoutOptions) -> m (Maybe CheckoutOptions)
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    Ptr CheckoutOptions
result <- Ptr RebaseOptions -> IO (Ptr CheckoutOptions)
ggit_rebase_options_get_checkout_options Ptr RebaseOptions
rebaseOptions'
    Maybe CheckoutOptions
maybeResult <- Ptr CheckoutOptions
-> (Ptr CheckoutOptions -> IO CheckoutOptions)
-> IO (Maybe CheckoutOptions)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CheckoutOptions
result ((Ptr CheckoutOptions -> IO CheckoutOptions)
 -> IO (Maybe CheckoutOptions))
-> (Ptr CheckoutOptions -> IO CheckoutOptions)
-> IO (Maybe CheckoutOptions)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr CheckoutOptions
result' -> do
        CheckoutOptions
result'' <- ((ManagedPtr CheckoutOptions -> CheckoutOptions)
-> Ptr CheckoutOptions -> IO CheckoutOptions
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr CheckoutOptions -> CheckoutOptions
Ggit.CheckoutOptions.CheckoutOptions) Ptr CheckoutOptions
result'
        CheckoutOptions -> IO CheckoutOptions
forall (m :: * -> *) a. Monad m => a -> m a
return CheckoutOptions
result''
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    Maybe CheckoutOptions -> IO (Maybe CheckoutOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe CheckoutOptions
maybeResult

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsGetCheckoutOptionsMethodInfo
instance (signature ~ (m (Maybe Ggit.CheckoutOptions.CheckoutOptions)), MonadIO m) => O.MethodInfo RebaseOptionsGetCheckoutOptionsMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsGetCheckoutOptions

#endif

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

foreign import ccall "ggit_rebase_options_get_quiet" ggit_rebase_options_get_quiet :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    IO CInt

-- | Gets whether you want a quiet rebase experience.
rebaseOptionsGetQuiet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    -- ^ /@rebaseOptions@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
    -> m Bool
    -- ^ __Returns:__ returns whether you want a quiet rebase experience.
rebaseOptionsGetQuiet :: RebaseOptions -> m Bool
rebaseOptionsGetQuiet rebaseOptions :: RebaseOptions
rebaseOptions = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    CInt
result <- Ptr RebaseOptions -> IO CInt
ggit_rebase_options_get_quiet Ptr RebaseOptions
rebaseOptions'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsGetQuietMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo RebaseOptionsGetQuietMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsGetQuiet

#endif

-- method RebaseOptions::get_rewrite_notes_ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOptions."
--                 , 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_options_get_rewrite_notes_ref" ggit_rebase_options_get_rewrite_notes_ref :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    IO CString

-- | Gets the the name of the notes reference used to rewrite notes for rebased
-- commits when finishing the rebase or 'P.Nothing' if not set.
rebaseOptionsGetRewriteNotesRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    -- ^ /@rebaseOptions@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the name of the notes reference or 'P.Nothing'.
rebaseOptionsGetRewriteNotesRef :: RebaseOptions -> m (Maybe Text)
rebaseOptionsGetRewriteNotesRef rebaseOptions :: RebaseOptions
rebaseOptions = IO (Maybe Text) -> m (Maybe Text)
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 RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    CString
result <- Ptr RebaseOptions -> IO CString
ggit_rebase_options_get_rewrite_notes_ref Ptr RebaseOptions
rebaseOptions'
    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
$ \result' :: CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsGetRewriteNotesRefMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.MethodInfo RebaseOptionsGetRewriteNotesRefMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsGetRewriteNotesRef

#endif

-- method RebaseOptions::set_checkout_options
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checkout_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "CheckoutOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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_options_set_checkout_options" ggit_rebase_options_set_checkout_options :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    Ptr Ggit.CheckoutOptions.CheckoutOptions -> -- checkout_options : TInterface (Name {namespace = "Ggit", name = "CheckoutOptions"})
    IO ()

-- | /No description available in the introspection data./
rebaseOptionsSetCheckoutOptions ::
    (B.CallStack.HasCallStack, MonadIO m, Ggit.CheckoutOptions.IsCheckoutOptions a) =>
    RebaseOptions
    -> a
    -> m ()
rebaseOptionsSetCheckoutOptions :: RebaseOptions -> a -> m ()
rebaseOptionsSetCheckoutOptions rebaseOptions :: RebaseOptions
rebaseOptions checkoutOptions :: a
checkoutOptions = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    Ptr CheckoutOptions
checkoutOptions' <- a -> IO (Ptr CheckoutOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
checkoutOptions
    Ptr RebaseOptions -> Ptr CheckoutOptions -> IO ()
ggit_rebase_options_set_checkout_options Ptr RebaseOptions
rebaseOptions' Ptr CheckoutOptions
checkoutOptions'
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
checkoutOptions
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsSetCheckoutOptionsMethodInfo
instance (signature ~ (a -> m ()), MonadIO m, Ggit.CheckoutOptions.IsCheckoutOptions a) => O.MethodInfo RebaseOptionsSetCheckoutOptionsMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsSetCheckoutOptions

#endif

-- method RebaseOptions::set_quiet
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOptions."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "quiet"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "whether you want a quiet rebase experience."
--                 , 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_options_set_quiet" ggit_rebase_options_set_quiet :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    CInt ->                                 -- quiet : TBasicType TBoolean
    IO ()

-- | Used by @/ggit_rebase_init()/@, this will instruct other clients working
-- on this rebase that you want a quiet rebase experience, which they
-- may choose to provide in an application-specific manner.  This has no
-- effect upon libgit2-glib directly, but is provided for interoperability
-- between Git tools.
rebaseOptionsSetQuiet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    -- ^ /@rebaseOptions@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
    -> Bool
    -- ^ /@quiet@/: whether you want a quiet rebase experience.
    -> m ()
rebaseOptionsSetQuiet :: RebaseOptions -> Bool -> m ()
rebaseOptionsSetQuiet rebaseOptions :: RebaseOptions
rebaseOptions quiet :: Bool
quiet = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    let quiet' :: CInt
quiet' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
quiet
    Ptr RebaseOptions -> CInt -> IO ()
ggit_rebase_options_set_quiet Ptr RebaseOptions
rebaseOptions' CInt
quiet'
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsSetQuietMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.MethodInfo RebaseOptionsSetQuietMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsSetQuiet

#endif

-- method RebaseOptions::set_rewrite_notes_ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "rebase_options"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RebaseOptions" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRebaseOptions."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "rewrite_notes_ref"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the notes reference."
--                 , 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_options_set_rewrite_notes_ref" ggit_rebase_options_set_rewrite_notes_ref :: 
    Ptr RebaseOptions ->                    -- rebase_options : TInterface (Name {namespace = "Ggit", name = "RebaseOptions"})
    CString ->                              -- rewrite_notes_ref : TBasicType TUTF8
    IO ()

-- | Used by 'GI.Ggit.Objects.Rebase.rebaseFinish', this is the name of the notes reference
-- used to rewrite notes for rebased commits when finishing the rebase;
-- if 'P.Nothing', the contents of the configuration option @notes.rewriteRef@
-- is examined, unless the configuration option @notes.rewrite.rebase@
-- is set to false.  If @notes.rewriteRef@ is also 'P.Nothing', notes will
-- not be rewritten.
rebaseOptionsSetRewriteNotesRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    -- ^ /@rebaseOptions@/: a t'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
    -> T.Text
    -- ^ /@rewriteNotesRef@/: the name of the notes reference.
    -> m ()
rebaseOptionsSetRewriteNotesRef :: RebaseOptions -> Text -> m ()
rebaseOptionsSetRewriteNotesRef rebaseOptions :: RebaseOptions
rebaseOptions rewriteNotesRef :: Text
rewriteNotesRef = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RebaseOptions
rebaseOptions' <- RebaseOptions -> IO (Ptr RebaseOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RebaseOptions
rebaseOptions
    CString
rewriteNotesRef' <- Text -> IO CString
textToCString Text
rewriteNotesRef
    Ptr RebaseOptions -> CString -> IO ()
ggit_rebase_options_set_rewrite_notes_ref Ptr RebaseOptions
rebaseOptions' CString
rewriteNotesRef'
    RebaseOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RebaseOptions
rebaseOptions
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rewriteNotesRef'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RebaseOptionsSetRewriteNotesRefMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo RebaseOptionsSetRewriteNotesRefMethodInfo RebaseOptions signature where
    overloadedMethod = rebaseOptionsSetRewriteNotesRef

#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveRebaseOptionsMethod (t :: Symbol) (o :: *) :: * where
    ResolveRebaseOptionsMethod "copy" o = RebaseOptionsCopyMethodInfo
    ResolveRebaseOptionsMethod "free" o = RebaseOptionsFreeMethodInfo
    ResolveRebaseOptionsMethod "getCheckoutOptions" o = RebaseOptionsGetCheckoutOptionsMethodInfo
    ResolveRebaseOptionsMethod "getQuiet" o = RebaseOptionsGetQuietMethodInfo
    ResolveRebaseOptionsMethod "getRewriteNotesRef" o = RebaseOptionsGetRewriteNotesRefMethodInfo
    ResolveRebaseOptionsMethod "setCheckoutOptions" o = RebaseOptionsSetCheckoutOptionsMethodInfo
    ResolveRebaseOptionsMethod "setQuiet" o = RebaseOptionsSetQuietMethodInfo
    ResolveRebaseOptionsMethod "setRewriteNotesRef" o = RebaseOptionsSetRewriteNotesRefMethodInfo
    ResolveRebaseOptionsMethod l o = O.MethodResolutionFailed l o

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

#endif