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

'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult' gives a single result from an
'GI.OSTree.Interfaces.RepoFinder.repoFinderResolveAsync' or 'GI.OSTree.Functions.repoFinderResolveAllAsync'
operation. This represents a single remote which provides none, some or all
of the refs being resolved. The structure includes various bits of metadata
which allow 'GI.OSTree.Objects.Repo.repoPullFromRemotesAsync' (for example) to prioritise
how to pull the refs.

The /@priority@/ is used as one input of many to ordering functions like
'GI.OSTree.Structs.RepoFinderResult.repoFinderResultCompare'.

/@refToChecksum@/ indicates which refs (out of the ones queried for as inputs
to 'GI.OSTree.Interfaces.RepoFinder.repoFinderResolveAsync') are provided by this remote. The refs
are present as keys (of type 'GI.OSTree.Structs.CollectionRef.CollectionRef'), and the corresponding values
are the checksums of the commits the remote currently has for those refs. (These
might not be the latest commits available out of all results.) A
checksum may be 'Nothing' if the remote does not advertise the corresponding ref.
After 'GI.OSTree.Interfaces.RepoFinder.repoFinderResolveAsync' has been called, the commit metadata
should be available locally, so the details for each checksum can be looked
up using 'GI.OSTree.Objects.Repo.repoLoadCommit'.

/@refToTimestamp@/ provides timestamps for the set of refs in
/@refToChecksum@/. The refs are keys (of type 'GI.OSTree.Structs.CollectionRef.CollectionRef') and the
values are guint64 pointers with the timestamp associated with the checksum
provided in /@refToChecksum@/. /@refToTimestamp@/ can be 'Nothing', and when it\'s
not, the timestamps are zero when any of the following conditions are met:
(1) the override-commit-ids option was used on
ostree_repo_find_remotes_async (2) there was an error in trying to get the
commit metadata (3) the checksum for this ref is 'Nothing' in /@refToChecksum@/.

/Since: 2018.6/
-}

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

module GI.OSTree.Structs.RepoFinderResult
    (

-- * Exported types
    RepoFinderResult(..)                    ,
    newZeroRepoFinderResult                 ,
    noRepoFinderResult                      ,


 -- * Methods
-- ** compare #method:compare#

#if ENABLE_OVERLOADING
    RepoFinderResultCompareMethodInfo       ,
#endif
    repoFinderResultCompare                 ,


-- ** dup #method:dup#

#if ENABLE_OVERLOADING
    RepoFinderResultDupMethodInfo           ,
#endif
    repoFinderResultDup                     ,


-- ** free #method:free#

#if ENABLE_OVERLOADING
    RepoFinderResultFreeMethodInfo          ,
#endif
    repoFinderResultFree                    ,


-- ** freev #method:freev#

    repoFinderResultFreev                   ,




 -- * Properties
-- ** finder #attr:finder#
{- | the 'GI.OSTree.Interfaces.RepoFinder.RepoFinder' instance which produced this result
-}
    clearRepoFinderResultFinder             ,
    getRepoFinderResultFinder               ,
#if ENABLE_OVERLOADING
    repoFinderResult_finder                 ,
#endif
    setRepoFinderResultFinder               ,


-- ** priority #attr:priority#
{- | static priority of the result, where higher numbers indicate lower
   priority
-}
    getRepoFinderResultPriority             ,
#if ENABLE_OVERLOADING
    repoFinderResult_priority               ,
#endif
    setRepoFinderResultPriority             ,


-- ** remote #attr:remote#
{- | 'GI.OSTree.Structs.Remote.Remote' which contains the transport details for the result,
   such as its URI and GPG key
-}
    clearRepoFinderResultRemote             ,
    getRepoFinderResultRemote               ,
#if ENABLE_OVERLOADING
    repoFinderResult_remote                 ,
#endif
    setRepoFinderResultRemote               ,


-- ** summaryLastModified #attr:summaryLastModified#
{- | Unix timestamp (seconds since the epoch, UTC) when
   the summary file on the remote was last modified, or @0@ if unknown
-}
    getRepoFinderResultSummaryLastModified  ,
#if ENABLE_OVERLOADING
    repoFinderResult_summaryLastModified    ,
#endif
    setRepoFinderResultSummaryLastModified  ,




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

import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote

-- | Memory-managed wrapper type.
newtype RepoFinderResult = RepoFinderResult (ManagedPtr RepoFinderResult)
foreign import ccall "ostree_repo_finder_result_get_type" c_ostree_repo_finder_result_get_type ::
    IO GType

instance BoxedObject RepoFinderResult where
    boxedType _ = c_ostree_repo_finder_result_get_type

-- | Construct a `RepoFinderResult` struct initialized to zero.
newZeroRepoFinderResult :: MonadIO m => m RepoFinderResult
newZeroRepoFinderResult = liftIO $ callocBoxedBytes 72 >>= wrapBoxed RepoFinderResult

instance tag ~ 'AttrSet => Constructible RepoFinderResult tag where
    new _ attrs = do
        o <- newZeroRepoFinderResult
        GI.Attributes.set o attrs
        return o


-- | A convenience alias for `Nothing` :: `Maybe` `RepoFinderResult`.
noRepoFinderResult :: Maybe RepoFinderResult
noRepoFinderResult = Nothing

{- |
Get the value of the “@remote@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' repoFinderResult #remote
@
-}
getRepoFinderResultRemote :: MonadIO m => RepoFinderResult -> m (Maybe OSTree.Remote.Remote)
getRepoFinderResultRemote s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO (Ptr OSTree.Remote.Remote)
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- (newBoxed OSTree.Remote.Remote) val'
        return val''
    return result

{- |
Set the value of the “@remote@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' repoFinderResult [ #remote 'Data.GI.Base.Attributes.:=' value ]
@
-}
setRepoFinderResultRemote :: MonadIO m => RepoFinderResult -> Ptr OSTree.Remote.Remote -> m ()
setRepoFinderResultRemote s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (val :: Ptr OSTree.Remote.Remote)

{- |
Set the value of the “@remote@” field to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.clear' #remote
@
-}
clearRepoFinderResultRemote :: MonadIO m => RepoFinderResult -> m ()
clearRepoFinderResultRemote s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr OSTree.Remote.Remote)

#if ENABLE_OVERLOADING
data RepoFinderResultRemoteFieldInfo
instance AttrInfo RepoFinderResultRemoteFieldInfo where
    type AttrAllowedOps RepoFinderResultRemoteFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint RepoFinderResultRemoteFieldInfo = (~) (Ptr OSTree.Remote.Remote)
    type AttrBaseTypeConstraint RepoFinderResultRemoteFieldInfo = (~) RepoFinderResult
    type AttrGetType RepoFinderResultRemoteFieldInfo = Maybe OSTree.Remote.Remote
    type AttrLabel RepoFinderResultRemoteFieldInfo = "remote"
    type AttrOrigin RepoFinderResultRemoteFieldInfo = RepoFinderResult
    attrGet _ = getRepoFinderResultRemote
    attrSet _ = setRepoFinderResultRemote
    attrConstruct = undefined
    attrClear _ = clearRepoFinderResultRemote

repoFinderResult_remote :: AttrLabelProxy "remote"
repoFinderResult_remote = AttrLabelProxy

#endif


{- |
Get the value of the “@finder@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' repoFinderResult #finder
@
-}
getRepoFinderResultFinder :: MonadIO m => RepoFinderResult -> m (Maybe OSTree.RepoFinder.RepoFinder)
getRepoFinderResultFinder s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO (Ptr OSTree.RepoFinder.RepoFinder)
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- (newObject OSTree.RepoFinder.RepoFinder) val'
        return val''
    return result

{- |
Set the value of the “@finder@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' repoFinderResult [ #finder 'Data.GI.Base.Attributes.:=' value ]
@
-}
setRepoFinderResultFinder :: MonadIO m => RepoFinderResult -> Ptr OSTree.RepoFinder.RepoFinder -> m ()
setRepoFinderResultFinder s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (val :: Ptr OSTree.RepoFinder.RepoFinder)

{- |
Set the value of the “@finder@” field to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.clear' #finder
@
-}
clearRepoFinderResultFinder :: MonadIO m => RepoFinderResult -> m ()
clearRepoFinderResultFinder s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr OSTree.RepoFinder.RepoFinder)

#if ENABLE_OVERLOADING
data RepoFinderResultFinderFieldInfo
instance AttrInfo RepoFinderResultFinderFieldInfo where
    type AttrAllowedOps RepoFinderResultFinderFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint RepoFinderResultFinderFieldInfo = (~) (Ptr OSTree.RepoFinder.RepoFinder)
    type AttrBaseTypeConstraint RepoFinderResultFinderFieldInfo = (~) RepoFinderResult
    type AttrGetType RepoFinderResultFinderFieldInfo = Maybe OSTree.RepoFinder.RepoFinder
    type AttrLabel RepoFinderResultFinderFieldInfo = "finder"
    type AttrOrigin RepoFinderResultFinderFieldInfo = RepoFinderResult
    attrGet _ = getRepoFinderResultFinder
    attrSet _ = setRepoFinderResultFinder
    attrConstruct = undefined
    attrClear _ = clearRepoFinderResultFinder

repoFinderResult_finder :: AttrLabelProxy "finder"
repoFinderResult_finder = AttrLabelProxy

#endif


{- |
Get the value of the “@priority@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' repoFinderResult #priority
@
-}
getRepoFinderResultPriority :: MonadIO m => RepoFinderResult -> m Int32
getRepoFinderResultPriority s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO Int32
    return val

{- |
Set the value of the “@priority@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' repoFinderResult [ #priority 'Data.GI.Base.Attributes.:=' value ]
@
-}
setRepoFinderResultPriority :: MonadIO m => RepoFinderResult -> Int32 -> m ()
setRepoFinderResultPriority s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (val :: Int32)

#if ENABLE_OVERLOADING
data RepoFinderResultPriorityFieldInfo
instance AttrInfo RepoFinderResultPriorityFieldInfo where
    type AttrAllowedOps RepoFinderResultPriorityFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint RepoFinderResultPriorityFieldInfo = (~) Int32
    type AttrBaseTypeConstraint RepoFinderResultPriorityFieldInfo = (~) RepoFinderResult
    type AttrGetType RepoFinderResultPriorityFieldInfo = Int32
    type AttrLabel RepoFinderResultPriorityFieldInfo = "priority"
    type AttrOrigin RepoFinderResultPriorityFieldInfo = RepoFinderResult
    attrGet _ = getRepoFinderResultPriority
    attrSet _ = setRepoFinderResultPriority
    attrConstruct = undefined
    attrClear _ = undefined

repoFinderResult_priority :: AttrLabelProxy "priority"
repoFinderResult_priority = AttrLabelProxy

#endif


-- XXX Skipped attribute for "RepoFinderResult:ref_to_checksum" :: Not implemented: "GHashTable element of type TInterface (Name {namespace = \"OSTree\", name = \"CollectionRef\"}) unsupported."
{- |
Get the value of the “@summary_last_modified@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' repoFinderResult #summaryLastModified
@
-}
getRepoFinderResultSummaryLastModified :: MonadIO m => RepoFinderResult -> m Word64
getRepoFinderResultSummaryLastModified s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO Word64
    return val

{- |
Set the value of the “@summary_last_modified@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' repoFinderResult [ #summaryLastModified 'Data.GI.Base.Attributes.:=' value ]
@
-}
setRepoFinderResultSummaryLastModified :: MonadIO m => RepoFinderResult -> Word64 -> m ()
setRepoFinderResultSummaryLastModified s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 32) (val :: Word64)

#if ENABLE_OVERLOADING
data RepoFinderResultSummaryLastModifiedFieldInfo
instance AttrInfo RepoFinderResultSummaryLastModifiedFieldInfo where
    type AttrAllowedOps RepoFinderResultSummaryLastModifiedFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint RepoFinderResultSummaryLastModifiedFieldInfo = (~) Word64
    type AttrBaseTypeConstraint RepoFinderResultSummaryLastModifiedFieldInfo = (~) RepoFinderResult
    type AttrGetType RepoFinderResultSummaryLastModifiedFieldInfo = Word64
    type AttrLabel RepoFinderResultSummaryLastModifiedFieldInfo = "summary_last_modified"
    type AttrOrigin RepoFinderResultSummaryLastModifiedFieldInfo = RepoFinderResult
    attrGet _ = getRepoFinderResultSummaryLastModified
    attrSet _ = setRepoFinderResultSummaryLastModified
    attrConstruct = undefined
    attrClear _ = undefined

repoFinderResult_summaryLastModified :: AttrLabelProxy "summaryLastModified"
repoFinderResult_summaryLastModified = AttrLabelProxy

#endif


-- XXX Skipped attribute for "RepoFinderResult:ref_to_timestamp" :: Not implemented: "GHashTable element of type TInterface (Name {namespace = \"OSTree\", name = \"CollectionRef\"}) unsupported."

#if ENABLE_OVERLOADING
instance O.HasAttributeList RepoFinderResult
type instance O.AttributeList RepoFinderResult = RepoFinderResultAttributeList
type RepoFinderResultAttributeList = ('[ '("remote", RepoFinderResultRemoteFieldInfo), '("finder", RepoFinderResultFinderFieldInfo), '("priority", RepoFinderResultPriorityFieldInfo), '("summaryLastModified", RepoFinderResultSummaryLastModifiedFieldInfo)] :: [(Symbol, *)])
#endif

-- XXX Could not generate method RepoFinderResult::new
-- Error was : Not implemented: "GHashTable key of type TInterface (Name {namespace = \"OSTree\", name = \"CollectionRef\"}) unsupported."
-- method RepoFinderResult::compare
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "a", argType = TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #OstreeRepoFinderResult", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "b", argType = TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #OstreeRepoFinderResult", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_result_compare" ostree_repo_finder_result_compare ::
    Ptr RepoFinderResult ->                 -- a : TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"})
    Ptr RepoFinderResult ->                 -- b : TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"})
    IO Int32

{- |
Compare two 'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult' instances to work out which one is better
to pull from, and hence needs to be ordered before the other.

/Since: 2018.6/
-}
repoFinderResultCompare ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RepoFinderResult
    {- ^ /@a@/: an 'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult' -}
    -> RepoFinderResult
    {- ^ /@b@/: an 'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult' -}
    -> m Int32
    {- ^ __Returns:__ \<0 if /@a@/ is ordered before /@b@/, 0 if they are ordered equally,
   >0 if /@b@/ is ordered before /@a@/ -}
repoFinderResultCompare a b = liftIO $ do
    a' <- unsafeManagedPtrGetPtr a
    b' <- unsafeManagedPtrGetPtr b
    result <- ostree_repo_finder_result_compare a' b'
    touchManagedPtr a
    touchManagedPtr b
    return result

#if ENABLE_OVERLOADING
data RepoFinderResultCompareMethodInfo
instance (signature ~ (RepoFinderResult -> m Int32), MonadIO m) => O.MethodInfo RepoFinderResultCompareMethodInfo RepoFinderResult signature where
    overloadedMethod _ = repoFinderResultCompare

#endif

-- method RepoFinderResult::dup
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "result", argType = TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #OstreeRepoFinderResult to copy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"}))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_result_dup" ostree_repo_finder_result_dup ::
    Ptr RepoFinderResult ->                 -- result : TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"})
    IO (Ptr RepoFinderResult)

{- |
Copy an 'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult'.

/Since: 2018.6/
-}
repoFinderResultDup ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RepoFinderResult
    {- ^ /@result@/: an 'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult' to copy -}
    -> m RepoFinderResult
    {- ^ __Returns:__ a newly allocated copy of /@result@/ -}
repoFinderResultDup result_ = liftIO $ do
    result_' <- unsafeManagedPtrGetPtr result_
    result <- ostree_repo_finder_result_dup result_'
    checkUnexpectedReturnNULL "repoFinderResultDup" result
    result' <- (wrapBoxed RepoFinderResult) result
    touchManagedPtr result_
    return result'

#if ENABLE_OVERLOADING
data RepoFinderResultDupMethodInfo
instance (signature ~ (m RepoFinderResult), MonadIO m) => O.MethodInfo RepoFinderResultDupMethodInfo RepoFinderResult signature where
    overloadedMethod _ = repoFinderResultDup

#endif

-- method RepoFinderResult::free
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "result", argType = TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #OstreeRepoFinderResult", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_result_free" ostree_repo_finder_result_free ::
    Ptr RepoFinderResult ->                 -- result : TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"})
    IO ()

{- |
Free the given /@result@/.

/Since: 2018.6/
-}
repoFinderResultFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    RepoFinderResult
    {- ^ /@result@/: an 'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult' -}
    -> m ()
repoFinderResultFree result_ = liftIO $ do
    result_' <- B.ManagedPtr.disownBoxed result_
    ostree_repo_finder_result_free result_'
    touchManagedPtr result_
    return ()

#if ENABLE_OVERLOADING
data RepoFinderResultFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo RepoFinderResultFreeMethodInfo RepoFinderResult signature where
    overloadedMethod _ = repoFinderResultFree

#endif

-- method RepoFinderResult::freev
-- method type : MemberFunction
-- Args : [Arg {argCName = "results", argType = TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an #OstreeRepoFinderResult", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_result_freev" ostree_repo_finder_result_freev ::
    Ptr (Ptr RepoFinderResult) ->           -- results : TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"}))
    IO ()

{- |
Free the given /@results@/ array, freeing each element and the container.

/Since: 2018.6/
-}
repoFinderResultFreev ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [RepoFinderResult]
    {- ^ /@results@/: an 'GI.OSTree.Structs.RepoFinderResult.RepoFinderResult' -}
    -> m ()
repoFinderResultFreev results = liftIO $ do
    results' <- mapM B.ManagedPtr.disownBoxed results
    results'' <- packZeroTerminatedPtrArray results'
    ostree_repo_finder_result_freev results''
    mapM_ touchManagedPtr results
    return ()

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type family ResolveRepoFinderResultMethod (t :: Symbol) (o :: *) :: * where
    ResolveRepoFinderResultMethod "compare" o = RepoFinderResultCompareMethodInfo
    ResolveRepoFinderResultMethod "dup" o = RepoFinderResultDupMethodInfo
    ResolveRepoFinderResultMethod "free" o = RepoFinderResultFreeMethodInfo
    ResolveRepoFinderResultMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveRepoFinderResultMethod t RepoFinderResult, O.MethodInfo info RepoFinderResult p) => OL.IsLabel t (RepoFinderResult -> 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