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

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

module GI.Ggit.Objects.CloneOptions
    (

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


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

#if defined(ENABLE_OVERLOADING)
    ResolveCloneOptionsMethod               ,
#endif


-- ** getCheckoutBranch #method:getCheckoutBranch#

#if defined(ENABLE_OVERLOADING)
    CloneOptionsGetCheckoutBranchMethodInfo ,
#endif
    cloneOptionsGetCheckoutBranch           ,


-- ** getFetchOptions #method:getFetchOptions#

#if defined(ENABLE_OVERLOADING)
    CloneOptionsGetFetchOptionsMethodInfo   ,
#endif
    cloneOptionsGetFetchOptions             ,


-- ** getIsBare #method:getIsBare#

#if defined(ENABLE_OVERLOADING)
    CloneOptionsGetIsBareMethodInfo         ,
#endif
    cloneOptionsGetIsBare                   ,


-- ** getLocal #method:getLocal#

#if defined(ENABLE_OVERLOADING)
    CloneOptionsGetLocalMethodInfo          ,
#endif
    cloneOptionsGetLocal                    ,


-- ** new #method:new#

    cloneOptionsNew                         ,


-- ** setCheckoutBranch #method:setCheckoutBranch#

#if defined(ENABLE_OVERLOADING)
    CloneOptionsSetCheckoutBranchMethodInfo ,
#endif
    cloneOptionsSetCheckoutBranch           ,


-- ** setFetchOptions #method:setFetchOptions#

#if defined(ENABLE_OVERLOADING)
    CloneOptionsSetFetchOptionsMethodInfo   ,
#endif
    cloneOptionsSetFetchOptions             ,


-- ** setIsBare #method:setIsBare#

#if defined(ENABLE_OVERLOADING)
    CloneOptionsSetIsBareMethodInfo         ,
#endif
    cloneOptionsSetIsBare                   ,


-- ** setLocal #method:setLocal#

#if defined(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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import 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)
    deriving (Eq)
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


-- | Convert 'CloneOptions' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue CloneOptions where
    toGValue o = do
        gtype <- c_ggit_clone_options_get_type
        B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)

    fromGValue gv = do
        ptr <- B.GValue.get_object gv :: IO (Ptr CloneOptions)
        B.ManagedPtr.newObject CloneOptions ptr



-- | Type class for types which can be safely cast to `CloneOptions`, for instance with `toCloneOptions`.
class (GObject o, O.IsDescendantOf CloneOptions o) => IsCloneOptions o
instance (GObject o, O.IsDescendantOf CloneOptions o) => IsCloneOptions o

instance O.HasParentTypes CloneOptions
type instance O.ParentTypes CloneOptions = '[GObject.Object.Object]

-- | 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 defined(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 "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    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) => OL.IsLabel t (CloneOptions -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(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 t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
cloneOptionsNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m CloneOptions
    -- ^ __Returns:__ a newly allocated t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
cloneOptionsNew  = liftIO $ do
    result <- ggit_clone_options_new
    checkUnexpectedReturnNULL "cloneOptionsNew" result
    result' <- (wrapObject CloneOptions) result
    return result'

#if defined(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 'P.Nothing'.
cloneOptionsGetCheckoutBranch ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    -- ^ /@options@/: a t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
    -> m T.Text
    -- ^ __Returns:__ the name of the branch to checkout or 'P.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 defined(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 'P.Nothing' if not set.
cloneOptionsGetFetchOptions ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    -- ^ /@options@/: a t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
    -> m Ggit.FetchOptions.FetchOptions
    -- ^ __Returns:__ the fetch options or 'P.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 defined(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 t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
    -> m Bool
    -- ^ __Returns:__ 'P.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 defined(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 t'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 defined(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. 'P.Nothing' means
-- use the remote\'s HEAD.
cloneOptionsSetCheckoutBranch ::
    (B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
    a
    -- ^ /@options@/: a t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
    -> Maybe (T.Text)
    -- ^ /@checkoutBranch@/: the name of the branch to checkout or 'P.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 defined(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 t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
    -> Maybe (Ggit.FetchOptions.FetchOptions)
    -- ^ /@fetchOptions@/: a t'GI.Ggit.Structs.FetchOptions.FetchOptions' or 'P.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 defined(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 t'GI.Ggit.Objects.CloneOptions.CloneOptions'.
    -> Bool
    -- ^ /@bare@/: 'P.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 defined(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 t'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 defined(ENABLE_OVERLOADING)
data CloneOptionsSetLocalMethodInfo
instance (signature ~ (Ggit.Enums.CloneLocal -> m ()), MonadIO m, IsCloneOptions a) => O.MethodInfo CloneOptionsSetLocalMethodInfo a signature where
    overloadedMethod = cloneOptionsSetLocal

#endif