{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Reprensents a git reference specification.

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

module GI.Ggit.Structs.RefSpec
    ( 

-- * Exported types
    RefSpec(..)                             ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveRefSpecMethod                    ,
#endif

-- ** getDestination #method:getDestination#

#if defined(ENABLE_OVERLOADING)
    RefSpecGetDestinationMethodInfo         ,
#endif
    refSpecGetDestination                   ,


-- ** getSource #method:getSource#

#if defined(ENABLE_OVERLOADING)
    RefSpecGetSourceMethodInfo              ,
#endif
    refSpecGetSource                        ,


-- ** isForced #method:isForced#

#if defined(ENABLE_OVERLOADING)
    RefSpecIsForcedMethodInfo               ,
#endif
    refSpecIsForced                         ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    RefSpecRefMethodInfo                    ,
#endif
    refSpecRef                              ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    RefSpecUnrefMethodInfo                  ,
#endif
    refSpecUnref                            ,




    ) 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.Coerce as Coerce
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 GHC.Records as R


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

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

foreign import ccall "ggit_ref_spec_get_type" c_ggit_ref_spec_get_type :: 
    IO GType

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

instance B.Types.TypedObject RefSpec where
    glibType :: IO GType
glibType = IO GType
c_ggit_ref_spec_get_type

instance B.Types.GBoxed RefSpec

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


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

-- method RefSpec::get_destination
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "refspec"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RefSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRefSpec." , 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_ref_spec_get_destination" ggit_ref_spec_get_destination :: 
    Ptr RefSpec ->                          -- refspec : TInterface (Name {namespace = "Ggit", name = "RefSpec"})
    IO CString

-- | Gets the /@refspec@/\'s destination.
refSpecGetDestination ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RefSpec
    -- ^ /@refspec@/: a t'GI.Ggit.Structs.RefSpec.RefSpec'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the refspec\'s destination or 'P.Nothing'.
refSpecGetDestination :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RefSpec -> m (Maybe Text)
refSpecGetDestination RefSpec
refspec = 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 RefSpec
refspec' <- RefSpec -> IO (Ptr RefSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RefSpec
refspec
    CString
result <- Ptr RefSpec -> IO CString
ggit_ref_spec_get_destination Ptr RefSpec
refspec'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    RefSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RefSpec
refspec
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data RefSpecGetDestinationMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod RefSpecGetDestinationMethodInfo RefSpec signature where
    overloadedMethod = refSpecGetDestination

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


#endif

-- method RefSpec::get_source
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "refspec"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RefSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRefSpec." , 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_ref_spec_get_source" ggit_ref_spec_get_source :: 
    Ptr RefSpec ->                          -- refspec : TInterface (Name {namespace = "Ggit", name = "RefSpec"})
    IO CString

-- | Gets the /@refspec@/\'s source.
refSpecGetSource ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RefSpec
    -- ^ /@refspec@/: a t'GI.Ggit.Structs.RefSpec.RefSpec'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the refspec\'s source or 'P.Nothing'.
refSpecGetSource :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RefSpec -> m (Maybe Text)
refSpecGetSource RefSpec
refspec = 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 RefSpec
refspec' <- RefSpec -> IO (Ptr RefSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RefSpec
refspec
    CString
result <- Ptr RefSpec -> IO CString
ggit_ref_spec_get_source Ptr RefSpec
refspec'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    RefSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RefSpec
refspec
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data RefSpecGetSourceMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod RefSpecGetSourceMethodInfo RefSpec signature where
    overloadedMethod = refSpecGetSource

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


#endif

-- method RefSpec::is_forced
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "refspec"
--           , argType =
--               TInterface Name { namespace = "Ggit" , name = "RefSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GgitRefSpec." , 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_ref_spec_is_forced" ggit_ref_spec_is_forced :: 
    Ptr RefSpec ->                          -- refspec : TInterface (Name {namespace = "Ggit", name = "RefSpec"})
    IO CInt

-- | Whether updating is done forcefully.
refSpecIsForced ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RefSpec
    -- ^ /@refspec@/: a t'GI.Ggit.Structs.RefSpec.RefSpec'.
    -> m Bool
    -- ^ __Returns:__ if updating is done forcefully.
refSpecIsForced :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
RefSpec -> m Bool
refSpecIsForced RefSpec
refspec = 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 RefSpec
refspec' <- RefSpec -> IO (Ptr RefSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RefSpec
refspec
    CInt
result <- Ptr RefSpec -> IO CInt
ggit_ref_spec_is_forced Ptr RefSpec
refspec'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    RefSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RefSpec
refspec
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data RefSpecIsForcedMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod RefSpecIsForcedMethodInfo RefSpec signature where
    overloadedMethod = refSpecIsForced

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


#endif

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

foreign import ccall "ggit_ref_spec_ref" ggit_ref_spec_ref :: 
    Ptr RefSpec ->                          -- refspec : TInterface (Name {namespace = "Ggit", name = "RefSpec"})
    IO (Ptr RefSpec)

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

#if defined(ENABLE_OVERLOADING)
data RefSpecRefMethodInfo
instance (signature ~ (m (Maybe RefSpec)), MonadIO m) => O.OverloadedMethod RefSpecRefMethodInfo RefSpec signature where
    overloadedMethod = refSpecRef

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


#endif

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

foreign import ccall "ggit_ref_spec_unref" ggit_ref_spec_unref :: 
    Ptr RefSpec ->                          -- refspec : TInterface (Name {namespace = "Ggit", name = "RefSpec"})
    IO ()

-- | Atomically decrements the reference count of /@refspec@/ by one.
-- If the reference count drops to 0, /@refspec@/ is freed.
refSpecUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RefSpec
    -- ^ /@refspec@/: a t'GI.Ggit.Structs.RefSpec.RefSpec'.
    -> m ()
refSpecUnref :: forall (m :: * -> *). (HasCallStack, MonadIO m) => RefSpec -> m ()
refSpecUnref RefSpec
refspec = 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 RefSpec
refspec' <- RefSpec -> IO (Ptr RefSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RefSpec
refspec
    Ptr RefSpec -> IO ()
ggit_ref_spec_unref Ptr RefSpec
refspec'
    RefSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RefSpec
refspec
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RefSpecUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod RefSpecUnrefMethodInfo RefSpec signature where
    overloadedMethod = refSpecUnref

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


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveRefSpecMethod (t :: Symbol) (o :: *) :: * where
    ResolveRefSpecMethod "isForced" o = RefSpecIsForcedMethodInfo
    ResolveRefSpecMethod "ref" o = RefSpecRefMethodInfo
    ResolveRefSpecMethod "unref" o = RefSpecUnrefMethodInfo
    ResolveRefSpecMethod "getDestination" o = RefSpecGetDestinationMethodInfo
    ResolveRefSpecMethod "getSource" o = RefSpecGetSourceMethodInfo
    ResolveRefSpecMethod l o = O.MethodResolutionFailed l o

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

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

#endif

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

#endif