{- |
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 cloning.
-}

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

module GI.Ggit.Objects.CloneOptions
    (

-- * Exported types
    CloneOptions(..)                        ,
    IsCloneOptions                          ,
    toCloneOptions                          ,
    noCloneOptions                          ,


 -- * Methods
-- ** getCheckoutBranch #method:getCheckoutBranch#

#if ENABLE_OVERLOADING
    CloneOptionsGetCheckoutBranchMethodInfo ,
#endif
    cloneOptionsGetCheckoutBranch           ,


-- ** getFetchOptions #method:getFetchOptions#

#if ENABLE_OVERLOADING
    CloneOptionsGetFetchOptionsMethodInfo   ,
#endif
    cloneOptionsGetFetchOptions             ,


-- ** getIsBare #method:getIsBare#

#if ENABLE_OVERLOADING
    CloneOptionsGetIsBareMethodInfo         ,
#endif
    cloneOptionsGetIsBare                   ,


-- ** getLocal #method:getLocal#

#if ENABLE_OVERLOADING
    CloneOptionsGetLocalMethodInfo          ,
#endif
    cloneOptionsGetLocal                    ,


-- ** new #method:new#

    cloneOptionsNew                         ,


-- ** setCheckoutBranch #method:setCheckoutBranch#

#if ENABLE_OVERLOADING
    CloneOptionsSetCheckoutBranchMethodInfo ,
#endif
    cloneOptionsSetCheckoutBranch           ,


-- ** setFetchOptions #method:setFetchOptions#

#if ENABLE_OVERLOADING
    CloneOptionsSetFetchOptionsMethodInfo   ,
#endif
    cloneOptionsSetFetchOptions             ,


-- ** setIsBare #method:setIsBare#

#if ENABLE_OVERLOADING
    CloneOptionsSetIsBareMethodInfo         ,
#endif
    cloneOptionsSetIsBare                   ,


-- ** setLocal #method:setLocal#

#if ENABLE_OVERLOADING
    CloneOptionsSetLocalMethodInfo          ,
#endif
    cloneOptionsSetLocal                    ,




    ) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Ggit.Enums as Ggit.Enums
import {-# SOURCE #-} qualified GI.Ggit.Structs.FetchOptions as Ggit.FetchOptions

-- | Memory-managed wrapper type.
newtype CloneOptions = CloneOptions (ManagedPtr CloneOptions)
foreign import ccall "ggit_clone_options_get_type"
    c_ggit_clone_options_get_type :: IO GType

instance GObject CloneOptions where
    gobjectType _ = c_ggit_clone_options_get_type


-- | Type class for types which can be safely cast to `CloneOptions`, for instance with `toCloneOptions`.
class GObject o => IsCloneOptions o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError CloneOptions a) =>
    IsCloneOptions a
#endif
instance IsCloneOptions CloneOptions
instance GObject.Object.IsObject CloneOptions

-- | Cast to `CloneOptions`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toCloneOptions :: (MonadIO m, IsCloneOptions o) => o -> m CloneOptions
toCloneOptions = liftIO . unsafeCastTo CloneOptions

-- | A convenience alias for `Nothing` :: `Maybe` `CloneOptions`.
noCloneOptions :: Maybe CloneOptions
noCloneOptions = Nothing

#if ENABLE_OVERLOADING
type family ResolveCloneOptionsMethod (t :: Symbol) (o :: *) :: * where
    ResolveCloneOptionsMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveCloneOptionsMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveCloneOptionsMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveCloneOptionsMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveCloneOptionsMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveCloneOptionsMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveCloneOptionsMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveCloneOptionsMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveCloneOptionsMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveCloneOptionsMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveCloneOptionsMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveCloneOptionsMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveCloneOptionsMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveCloneOptionsMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveCloneOptionsMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveCloneOptionsMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveCloneOptionsMethod "getCheckoutBranch" o = CloneOptionsGetCheckoutBranchMethodInfo
    ResolveCloneOptionsMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveCloneOptionsMethod "getFetchOptions" o = CloneOptionsGetFetchOptionsMethodInfo
    ResolveCloneOptionsMethod "getIsBare" o = CloneOptionsGetIsBareMethodInfo
    ResolveCloneOptionsMethod "getLocal" o = CloneOptionsGetLocalMethodInfo
    ResolveCloneOptionsMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveCloneOptionsMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveCloneOptionsMethod "setCheckoutBranch" o = CloneOptionsSetCheckoutBranchMethodInfo
    ResolveCloneOptionsMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveCloneOptionsMethod "setFetchOptions" o = CloneOptionsSetFetchOptionsMethodInfo
    ResolveCloneOptionsMethod "setIsBare" o = CloneOptionsSetIsBareMethodInfo
    ResolveCloneOptionsMethod "setLocal" o = CloneOptionsSetLocalMethodInfo
    ResolveCloneOptionsMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveCloneOptionsMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveCloneOptionsMethod t CloneOptions, O.MethodInfo info CloneOptions p) => O.IsLabelProxy t (CloneOptions -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveCloneOptionsMethod t CloneOptions, O.MethodInfo info CloneOptions p) => O.IsLabel t (CloneOptions -> 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

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

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type instance O.SignalList CloneOptions = CloneOptionsSignalList
type CloneOptionsSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

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

foreign import ccall "ggit_clone_options_new" ggit_clone_options_new ::
    IO (Ptr CloneOptions)

{- |
Creates a new 'GI.Ggit.Objects.CloneOptions.CloneOptions'.
-}
cloneOptionsNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m CloneOptions
    {- ^ __Returns:__ a newly allocated 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
cloneOptionsNew  = liftIO $ do
    result <- ggit_clone_options_new
    checkUnexpectedReturnNULL "cloneOptionsNew" result
    result' <- (wrapObject CloneOptions) result
    return result'

#if ENABLE_OVERLOADING
#endif

-- method CloneOptions::get_checkout_branch
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "options", argType = TInterface (Name {namespace = "Ggit", name = "CloneOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitCloneOptions.", 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_clone_options_get_checkout_branch" ggit_clone_options_get_checkout_branch ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    IO CString

{- |
Gets the name of the branch to checkout or 'Nothing'.
-}
cloneOptionsGetCheckoutBranch ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> m T.Text
    {- ^ __Returns:__ the name of the branch to checkout or 'Nothing'. -}
cloneOptionsGetCheckoutBranch options = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    result <- ggit_clone_options_get_checkout_branch options'
    checkUnexpectedReturnNULL "cloneOptionsGetCheckoutBranch" result
    result' <- cstringToText result
    touchManagedPtr options
    return result'

#if ENABLE_OVERLOADING
data CloneOptionsGetCheckoutBranchMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetCheckoutBranchMethodInfo a signature where
    overloadedMethod _ = cloneOptionsGetCheckoutBranch

#endif

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

foreign import ccall "ggit_clone_options_get_fetch_options" ggit_clone_options_get_fetch_options ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    IO (Ptr Ggit.FetchOptions.FetchOptions)

{- |
Get the fetch options object or 'Nothing' if not set.
-}
cloneOptionsGetFetchOptions ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> m Ggit.FetchOptions.FetchOptions
    {- ^ __Returns:__ the fetch options or 'Nothing'. -}
cloneOptionsGetFetchOptions options = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    result <- ggit_clone_options_get_fetch_options options'
    checkUnexpectedReturnNULL "cloneOptionsGetFetchOptions" result
    result' <- (newBoxed Ggit.FetchOptions.FetchOptions) result
    touchManagedPtr options
    return result'

#if ENABLE_OVERLOADING
data CloneOptionsGetFetchOptionsMethodInfo
instance (signature ~ (m Ggit.FetchOptions.FetchOptions), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetFetchOptionsMethodInfo a signature where
    overloadedMethod _ = cloneOptionsGetFetchOptions

#endif

-- method CloneOptions::get_is_bare
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "options", argType = TInterface (Name {namespace = "Ggit", name = "CloneOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitCloneOptions.", 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_clone_options_get_is_bare" ggit_clone_options_get_is_bare ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    IO CInt

{- |
Gets if the repository will be bare.
-}
cloneOptionsGetIsBare ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> m Bool
    {- ^ __Returns:__ 'True' to clone a bare repository. -}
cloneOptionsGetIsBare options = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    result <- ggit_clone_options_get_is_bare options'
    let result' = (/= 0) result
    touchManagedPtr options
    return result'

#if ENABLE_OVERLOADING
data CloneOptionsGetIsBareMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetIsBareMethodInfo a signature where
    overloadedMethod _ = cloneOptionsGetIsBare

#endif

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

foreign import ccall "ggit_clone_options_get_local" ggit_clone_options_get_local ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    IO CUInt

{- |
Get setting for bypassing the git-aware transport when cloning. The
default auto setting bypasses the git-aware transport for local paths,
but use a normal fetch for file:\/\/ URIs.
-}
cloneOptionsGetLocal ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> m Ggit.Enums.CloneLocal
    {- ^ __Returns:__ the local clone setting. -}
cloneOptionsGetLocal options = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    result <- ggit_clone_options_get_local options'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr options
    return result'

#if ENABLE_OVERLOADING
data CloneOptionsGetLocalMethodInfo
instance (signature ~ (m Ggit.Enums.CloneLocal), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsGetLocalMethodInfo a signature where
    overloadedMethod _ = cloneOptionsGetLocal

#endif

-- method CloneOptions::set_checkout_branch
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "options", argType = TInterface (Name {namespace = "Ggit", name = "CloneOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitCloneOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checkout_branch", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the name of the branch to checkout or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ggit_clone_options_set_checkout_branch" ggit_clone_options_set_checkout_branch ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    CString ->                              -- checkout_branch : TBasicType TUTF8
    IO ()

{- |
Gives the name of the branch to checkout. 'Nothing' means
use the remote\'s HEAD.
-}
cloneOptionsSetCheckoutBranch ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> Maybe (T.Text)
    {- ^ /@checkoutBranch@/: the name of the branch to checkout or 'Nothing'. -}
    -> m ()
cloneOptionsSetCheckoutBranch options checkoutBranch = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    maybeCheckoutBranch <- case checkoutBranch of
        Nothing -> return nullPtr
        Just jCheckoutBranch -> do
            jCheckoutBranch' <- textToCString jCheckoutBranch
            return jCheckoutBranch'
    ggit_clone_options_set_checkout_branch options' maybeCheckoutBranch
    touchManagedPtr options
    freeMem maybeCheckoutBranch
    return ()

#if ENABLE_OVERLOADING
data CloneOptionsSetCheckoutBranchMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetCheckoutBranchMethodInfo a signature where
    overloadedMethod _ = cloneOptionsSetCheckoutBranch

#endif

-- method CloneOptions::set_fetch_options
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "options", argType = TInterface (Name {namespace = "Ggit", name = "CloneOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitCloneOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "fetch_options", argType = TInterface (Name {namespace = "Ggit", name = "FetchOptions"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GgitFetchOptions or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ggit_clone_options_set_fetch_options" ggit_clone_options_set_fetch_options ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    Ptr Ggit.FetchOptions.FetchOptions ->   -- fetch_options : TInterface (Name {namespace = "Ggit", name = "FetchOptions"})
    IO ()

{- |
Set the fetch options object.
-}
cloneOptionsSetFetchOptions ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> Maybe (Ggit.FetchOptions.FetchOptions)
    {- ^ /@fetchOptions@/: a 'GI.Ggit.Structs.FetchOptions.FetchOptions' or 'Nothing'. -}
    -> m ()
cloneOptionsSetFetchOptions options fetchOptions = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    maybeFetchOptions <- case fetchOptions of
        Nothing -> return nullPtr
        Just jFetchOptions -> do
            jFetchOptions' <- unsafeManagedPtrGetPtr jFetchOptions
            return jFetchOptions'
    ggit_clone_options_set_fetch_options options' maybeFetchOptions
    touchManagedPtr options
    whenJust fetchOptions touchManagedPtr
    return ()

#if ENABLE_OVERLOADING
data CloneOptionsSetFetchOptionsMethodInfo
instance (signature ~ (Maybe (Ggit.FetchOptions.FetchOptions) -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetFetchOptionsMethodInfo a signature where
    overloadedMethod _ = cloneOptionsSetFetchOptions

#endif

-- method CloneOptions::set_is_bare
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "options", argType = TInterface (Name {namespace = "Ggit", name = "CloneOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitCloneOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "bare", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to clone a bare repository.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ggit_clone_options_set_is_bare" ggit_clone_options_set_is_bare ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    CInt ->                                 -- bare : TBasicType TBoolean
    IO ()

{- |
Sets whether to clone a bare repository.
-}
cloneOptionsSetIsBare ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> Bool
    {- ^ /@bare@/: 'True' to clone a bare repository. -}
    -> m ()
cloneOptionsSetIsBare options bare = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    let bare' = (fromIntegral . fromEnum) bare
    ggit_clone_options_set_is_bare options' bare'
    touchManagedPtr options
    return ()

#if ENABLE_OVERLOADING
data CloneOptionsSetIsBareMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetIsBareMethodInfo a signature where
    overloadedMethod _ = cloneOptionsSetIsBare

#endif

-- method CloneOptions::set_local
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "options", argType = TInterface (Name {namespace = "Ggit", name = "CloneOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GgitCloneOptions.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "local", argType = TInterface (Name {namespace = "Ggit", name = "CloneLocal"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the local clone setting.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ggit_clone_options_set_local" ggit_clone_options_set_local ::
    Ptr CloneOptions ->                     -- options : TInterface (Name {namespace = "Ggit", name = "CloneOptions"})
    CUInt ->                                -- local : TInterface (Name {namespace = "Ggit", name = "CloneLocal"})
    IO ()

{- |
Set setting for bypassing the git-aware transport when cloning. The
default auto setting bypasses the git-aware transport for local paths,
but use a normal fetch for file:\/\/ URIs.
-}
cloneOptionsSetLocal ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    {- ^ /@options@/: a 'GI.Ggit.Objects.CloneOptions.CloneOptions'. -}
    -> Ggit.Enums.CloneLocal
    {- ^ /@local@/: the local clone setting. -}
    -> m ()
cloneOptionsSetLocal options local = liftIO $ do
    options' <- unsafeManagedPtrCastPtr options
    let local' = (fromIntegral . fromEnum) local
    ggit_clone_options_set_local options' local'
    touchManagedPtr options
    return ()

#if ENABLE_OVERLOADING
data CloneOptionsSetLocalMethodInfo
instance (signature ~ (Ggit.Enums.CloneLocal -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetLocalMethodInfo a signature where
    overloadedMethod _ = cloneOptionsSetLocal

#endif