{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

Represents the options used when rebasing.
-}

module GI.Ggit.Structs.RebaseOptions
    ( 

-- * Exported types
    RebaseOptions(..)                       ,
    noRebaseOptions                         ,


 -- * Methods
-- ** copy #method:copy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    RebaseOptionsCopyMethodInfo             ,
#endif
    rebaseOptionsCopy                       ,


-- ** free #method:free#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    RebaseOptionsFreeMethodInfo             ,
#endif
    rebaseOptionsFree                       ,


-- ** getCheckoutOptions #method:getCheckoutOptions#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    RebaseOptionsGetCheckoutOptionsMethodInfo,
#endif
    rebaseOptionsGetCheckoutOptions         ,


-- ** getQuiet #method:getQuiet#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    RebaseOptionsGetQuietMethodInfo         ,
#endif
    rebaseOptionsGetQuiet                   ,


-- ** getRewriteNotesRef #method:getRewriteNotesRef#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    RebaseOptionsGetRewriteNotesRefMethodInfo,
#endif
    rebaseOptionsGetRewriteNotesRef         ,


-- ** new #method:new#
    rebaseOptionsNew                        ,


-- ** setCheckoutOptions #method:setCheckoutOptions#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    RebaseOptionsSetCheckoutOptionsMethodInfo,
#endif
    rebaseOptionsSetCheckoutOptions         ,


-- ** setQuiet #method:setQuiet#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    RebaseOptionsSetQuietMethodInfo         ,
#endif
    rebaseOptionsSetQuiet                   ,


-- ** setRewriteNotesRef #method:setRewriteNotesRef#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 {-# SOURCE #-} qualified GI.Ggit.Objects.CheckoutOptions as Ggit.CheckoutOptions

newtype RebaseOptions = RebaseOptions (ManagedPtr RebaseOptions)
foreign import ccall "ggit_rebase_options_get_type" c_ggit_rebase_options_get_type :: 
    IO GType

instance BoxedObject RebaseOptions where
    boxedType _ = c_ggit_rebase_options_get_type

noRebaseOptions :: Maybe RebaseOptions
noRebaseOptions = Nothing


#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
-}
rebaseOptionsNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m RebaseOptions
    {- ^ __Returns:__ a newly allocated 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
rebaseOptionsNew  = liftIO $ do
    result <- ggit_rebase_options_new
    checkUnexpectedReturnNULL "rebaseOptionsNew" result
    result' <- (wrapBoxed RebaseOptions) result
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#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 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'.
-}
rebaseOptionsCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    {- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
    -> m RebaseOptions
    {- ^ __Returns:__ a newly allocated 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
rebaseOptionsCopy rebaseOptions = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    result <- ggit_rebase_options_copy rebaseOptions'
    checkUnexpectedReturnNULL "rebaseOptionsCopy" result
    result' <- (wrapBoxed RebaseOptions) result
    touchManagedPtr rebaseOptions
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data RebaseOptionsCopyMethodInfo
instance (signature ~ (m 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 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
    -> m ()
rebaseOptionsFree rebaseOptions = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    ggit_rebase_options_free rebaseOptions'
    touchManagedPtr rebaseOptions
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 'Nothing' if not set.
-}
rebaseOptionsGetCheckoutOptions ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    {- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
    -> m Ggit.CheckoutOptions.CheckoutOptions
    {- ^ __Returns:__ the checkout options or 'Nothing'. -}
rebaseOptionsGetCheckoutOptions rebaseOptions = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    result <- ggit_rebase_options_get_checkout_options rebaseOptions'
    checkUnexpectedReturnNULL "rebaseOptionsGetCheckoutOptions" result
    result' <- (newObject Ggit.CheckoutOptions.CheckoutOptions) result
    touchManagedPtr rebaseOptions
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data RebaseOptionsGetCheckoutOptionsMethodInfo
instance (signature ~ (m 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 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
    -> m Bool
    {- ^ __Returns:__ returns whether you want a quiet rebase experience. -}
rebaseOptionsGetQuiet rebaseOptions = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    result <- ggit_rebase_options_get_quiet rebaseOptions'
    let result' = (/= 0) result
    touchManagedPtr rebaseOptions
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 'Nothing' if not set.
-}
rebaseOptionsGetRewriteNotesRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    {- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
    -> m T.Text
    {- ^ __Returns:__ the name of the notes reference or 'Nothing'. -}
rebaseOptionsGetRewriteNotesRef rebaseOptions = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    result <- ggit_rebase_options_get_rewrite_notes_ref rebaseOptions'
    checkUnexpectedReturnNULL "rebaseOptionsGetRewriteNotesRef" result
    result' <- cstringToText result
    touchManagedPtr rebaseOptions
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data RebaseOptionsGetRewriteNotesRefMethodInfo
instance (signature ~ (m 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 checkoutOptions = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    checkoutOptions' <- unsafeManagedPtrCastPtr checkoutOptions
    ggit_rebase_options_set_checkout_options rebaseOptions' checkoutOptions'
    touchManagedPtr rebaseOptions
    touchManagedPtr checkoutOptions
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
    -> Bool
    {- ^ /@quiet@/: whether you want a quiet rebase experience. -}
    -> m ()
rebaseOptionsSetQuiet rebaseOptions quiet = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    let quiet' = (fromIntegral . fromEnum) quiet
    ggit_rebase_options_set_quiet rebaseOptions' quiet'
    touchManagedPtr rebaseOptions
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 '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 'Nothing', notes will
not be rewritten.
-}
rebaseOptionsSetRewriteNotesRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RebaseOptions
    {- ^ /@rebaseOptions@/: a 'GI.Ggit.Structs.RebaseOptions.RebaseOptions'. -}
    -> T.Text
    {- ^ /@rewriteNotesRef@/: the name of the notes reference. -}
    -> m ()
rebaseOptionsSetRewriteNotesRef rebaseOptions rewriteNotesRef = liftIO $ do
    rebaseOptions' <- unsafeManagedPtrGetPtr rebaseOptions
    rewriteNotesRef' <- textToCString rewriteNotesRef
    ggit_rebase_options_set_rewrite_notes_ref rebaseOptions' rewriteNotesRef'
    touchManagedPtr rebaseOptions
    freeMem rewriteNotesRef'
    return ()

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

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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) => O.IsLabelProxy t (RebaseOptions -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

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

#endif