{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

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

module GI.OSTree.Interfaces.RepoFinder
    ( 

-- * Exported types
    RepoFinder(..)                          ,
    noRepoFinder                            ,
    IsRepoFinder                            ,
    toRepoFinder                            ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveRepoFinderMethod                 ,
#endif


-- ** resolveAllAsync #method:resolveAllAsync#

    repoFinderResolveAllAsync               ,


-- ** resolveAllFinish #method:resolveAllFinish#

    repoFinderResolveAllFinish              ,


-- ** resolveAsync #method:resolveAsync#

#if defined(ENABLE_OVERLOADING)
    RepoFinderResolveAsyncMethodInfo        ,
#endif
    repoFinderResolveAsync                  ,


-- ** resolveFinish #method:resolveFinish#

#if defined(ENABLE_OVERLOADING)
    RepoFinderResolveFinishMethodInfo       ,
#endif
    repoFinderResolveFinish                 ,




    ) 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 qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult

-- interface RepoFinder 
-- | Memory-managed wrapper type.
newtype RepoFinder = RepoFinder (ManagedPtr RepoFinder)
    deriving (RepoFinder -> RepoFinder -> Bool
(RepoFinder -> RepoFinder -> Bool)
-> (RepoFinder -> RepoFinder -> Bool) -> Eq RepoFinder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepoFinder -> RepoFinder -> Bool
$c/= :: RepoFinder -> RepoFinder -> Bool
== :: RepoFinder -> RepoFinder -> Bool
$c== :: RepoFinder -> RepoFinder -> Bool
Eq)
-- | A convenience alias for `Nothing` :: `Maybe` `RepoFinder`.
noRepoFinder :: Maybe RepoFinder
noRepoFinder :: Maybe RepoFinder
noRepoFinder = Maybe RepoFinder
forall a. Maybe a
Nothing

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

#endif

foreign import ccall "ostree_repo_finder_get_type"
    c_ostree_repo_finder_get_type :: IO GType

instance GObject RepoFinder where
    gobjectType :: IO GType
gobjectType = IO GType
c_ostree_repo_finder_get_type
    

-- | Convert 'RepoFinder' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue RepoFinder where
    toGValue :: RepoFinder -> IO GValue
toGValue o :: RepoFinder
o = do
        GType
gtype <- IO GType
c_ostree_repo_finder_get_type
        RepoFinder -> (Ptr RepoFinder -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinder
o (GType
-> (GValue -> Ptr RepoFinder -> IO ())
-> Ptr RepoFinder
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr RepoFinder -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO RepoFinder
fromGValue gv :: GValue
gv = do
        Ptr RepoFinder
ptr <- GValue -> IO (Ptr RepoFinder)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr RepoFinder)
        (ManagedPtr RepoFinder -> RepoFinder)
-> Ptr RepoFinder -> IO RepoFinder
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RepoFinder -> RepoFinder
RepoFinder Ptr RepoFinder
ptr
        
    

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

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

-- | Cast to `RepoFinder`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toRepoFinder :: (MonadIO m, IsRepoFinder o) => o -> m RepoFinder
toRepoFinder :: o -> m RepoFinder
toRepoFinder = IO RepoFinder -> m RepoFinder
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoFinder -> m RepoFinder)
-> (o -> IO RepoFinder) -> o -> m RepoFinder
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr RepoFinder -> RepoFinder) -> o -> IO RepoFinder
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr RepoFinder -> RepoFinder
RepoFinder

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

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveRepoFinderMethod (t :: Symbol) (o :: *) :: * where
    ResolveRepoFinderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveRepoFinderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveRepoFinderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveRepoFinderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveRepoFinderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveRepoFinderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveRepoFinderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveRepoFinderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveRepoFinderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveRepoFinderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveRepoFinderMethod "resolveAsync" o = RepoFinderResolveAsyncMethodInfo
    ResolveRepoFinderMethod "resolveFinish" o = RepoFinderResolveFinishMethodInfo
    ResolveRepoFinderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveRepoFinderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveRepoFinderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveRepoFinderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveRepoFinderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveRepoFinderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveRepoFinderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveRepoFinderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveRepoFinderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveRepoFinderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveRepoFinderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveRepoFinderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveRepoFinderMethod l o = O.MethodResolutionFailed l o

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

#endif

-- method RepoFinder::resolve_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFinder" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepoFinder"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refs"
--           , argType =
--               TCArray
--                 True
--                 (-1)
--                 (-1)
--                 (TInterface Name { namespace = "OSTree" , name = "CollectionRef" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "non-empty array of collection\8211ref pairs to find remotes for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent_repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the local repository which the refs are being resolved for,\n   which provides configuration information and GPG keys"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "asynchronous completion callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_resolve_async" ostree_repo_finder_resolve_async :: 
    Ptr RepoFinder ->                       -- self : TInterface (Name {namespace = "OSTree", name = "RepoFinder"})
    Ptr (Ptr OSTree.CollectionRef.CollectionRef) -> -- refs : TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "CollectionRef"}))
    Ptr OSTree.Repo.Repo ->                 -- parent_repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Find reachable remote URIs which claim to provide any of the given /@refs@/. The
-- specific method for finding the remotes depends on the t'GI.OSTree.Interfaces.RepoFinder.RepoFinder'
-- implementation.
-- 
-- Any remote which is found and which claims to support any of the given /@refs@/
-- will be returned in the results. It is possible that a remote claims to
-- support a given ref, but turns out not to — it is not possible to verify this
-- until 'GI.OSTree.Objects.Repo.repoPullFromRemotesAsync' is called.
-- 
-- The returned results will be sorted with the most useful first — this is
-- typically the remote which claims to provide the most /@refs@/, at the lowest
-- latency.
-- 
-- Each result contains a mapping of /@refs@/ to the checksums of the commits
-- which the result provides. If the result provides the latest commit for a ref
-- across all of the results, the checksum will be set. Otherwise, if the
-- result provides an outdated commit, or doesn’t provide a given ref at all,
-- the checksum will not be set. Results which provide none of the requested
-- /@refs@/ may be listed with an empty refs map.
-- 
-- Pass the results to 'GI.OSTree.Objects.Repo.repoPullFromRemotesAsync' to pull the given
-- /@refs@/ from those remotes.
-- 
-- /Since: 2018.6/
repoFinderResolveAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepoFinder a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.RepoFinder.RepoFinder'
    -> [OSTree.CollectionRef.CollectionRef]
    -- ^ /@refs@/: non-empty array of collection–ref pairs to find remotes for
    -> b
    -- ^ /@parentRepo@/: the local repository which the refs are being resolved for,
    --    which provides configuration information and GPG keys
    -> Maybe (c)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: asynchronous completion callback
    -> m ()
repoFinderResolveAsync :: a
-> [CollectionRef]
-> b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoFinderResolveAsync self :: a
self refs :: [CollectionRef]
refs parentRepo :: b
parentRepo cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 RepoFinder
self' <- a -> IO (Ptr RepoFinder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    [Ptr CollectionRef]
refs' <- (CollectionRef -> IO (Ptr CollectionRef))
-> [CollectionRef] -> IO [Ptr CollectionRef]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM CollectionRef -> IO (Ptr CollectionRef)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [CollectionRef]
refs
    Ptr (Ptr CollectionRef)
refs'' <- [Ptr CollectionRef] -> IO (Ptr (Ptr CollectionRef))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr CollectionRef]
refs'
    Ptr Repo
parentRepo' <- b -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
parentRepo
    Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
        Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just jCancellable :: c
jCancellable -> do
            Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jCallback :: AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr RepoFinder
-> Ptr (Ptr CollectionRef)
-> Ptr Repo
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_finder_resolve_async Ptr RepoFinder
self' Ptr (Ptr CollectionRef)
refs'' Ptr Repo
parentRepo' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    (CollectionRef -> IO ()) -> [CollectionRef] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ CollectionRef -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [CollectionRef]
refs
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
parentRepo
    Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr (Ptr CollectionRef) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CollectionRef)
refs''
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RepoFinderResolveAsyncMethodInfo
instance (signature ~ ([OSTree.CollectionRef.CollectionRef] -> b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepoFinder a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoFinderResolveAsyncMethodInfo a signature where
    overloadedMethod = repoFinderResolveAsync

#endif

-- method RepoFinder::resolve_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFinder" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepoFinder"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#GAsyncResult from the callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TPtrArray
--                  (TInterface
--                     Name { namespace = "OSTree" , name = "RepoFinderResult" }))
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_finder_resolve_finish" ostree_repo_finder_resolve_finish :: 
    Ptr RepoFinder ->                       -- self : TInterface (Name {namespace = "OSTree", name = "RepoFinder"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr (GPtrArray (Ptr OSTree.RepoFinderResult.RepoFinderResult)))

-- | Get the results from a 'GI.OSTree.Interfaces.RepoFinder.repoFinderResolveAsync' operation.
-- 
-- /Since: 2018.6/
repoFinderResolveFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepoFinder a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.RepoFinder.RepoFinder'
    -> b
    -- ^ /@result@/: t'GI.Gio.Interfaces.AsyncResult.AsyncResult' from the callback
    -> m [OSTree.RepoFinderResult.RepoFinderResult]
    -- ^ __Returns:__ array of zero
    --    or more results /(Can throw 'Data.GI.Base.GError.GError')/
repoFinderResolveFinish :: a -> b -> m [RepoFinderResult]
repoFinderResolveFinish self :: a
self result_ :: b
result_ = IO [RepoFinderResult] -> m [RepoFinderResult]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [RepoFinderResult] -> m [RepoFinderResult])
-> IO [RepoFinderResult] -> m [RepoFinderResult]
forall a b. (a -> b) -> a -> b
$ do
    Ptr RepoFinder
self' <- a -> IO (Ptr RepoFinder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO [RepoFinderResult] -> IO () -> IO [RepoFinderResult]
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr (GPtrArray (Ptr RepoFinderResult))
result <- (Ptr (Ptr GError) -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
-> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
 -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
-> (Ptr (Ptr GError)
    -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
-> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
forall a b. (a -> b) -> a -> b
$ Ptr RepoFinder
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
ostree_repo_finder_resolve_finish Ptr RepoFinder
self' Ptr AsyncResult
result_'
        Text -> Ptr (GPtrArray (Ptr RepoFinderResult)) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoFinderResolveFinish" Ptr (GPtrArray (Ptr RepoFinderResult))
result
        [Ptr RepoFinderResult]
result' <- Ptr (GPtrArray (Ptr RepoFinderResult)) -> IO [Ptr RepoFinderResult]
forall a. Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unpackGPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
        [RepoFinderResult]
result'' <- (Ptr RepoFinderResult -> IO RepoFinderResult)
-> [Ptr RepoFinderResult] -> IO [RepoFinderResult]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr RepoFinderResult -> RepoFinderResult)
-> Ptr RepoFinderResult -> IO RepoFinderResult
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoFinderResult -> RepoFinderResult
OSTree.RepoFinderResult.RepoFinderResult) [Ptr RepoFinderResult]
result'
        Ptr (GPtrArray (Ptr RepoFinderResult)) -> IO ()
forall a. Ptr (GPtrArray a) -> IO ()
unrefPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        [RepoFinderResult] -> IO [RepoFinderResult]
forall (m :: * -> *) a. Monad m => a -> m a
return [RepoFinderResult]
result''
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoFinderResolveFinishMethodInfo
instance (signature ~ (b -> m [OSTree.RepoFinderResult.RepoFinderResult]), MonadIO m, IsRepoFinder a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo RepoFinderResolveFinishMethodInfo a signature where
    overloadedMethod = repoFinderResolveFinish

#endif

-- method RepoFinder::resolve_all_async
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "finders"
--           , argType =
--               TCArray
--                 True
--                 (-1)
--                 (-1)
--                 (TInterface Name { namespace = "OSTree" , name = "RepoFinder" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "non-empty array of #OstreeRepoFinders"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refs"
--           , argType =
--               TCArray
--                 True
--                 (-1)
--                 (-1)
--                 (TInterface Name { namespace = "OSTree" , name = "CollectionRef" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "non-empty array of collection\8211ref pairs to find remotes for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent_repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the local repository which the refs are being resolved for,\n   which provides configuration information and GPG keys"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "asynchronous completion callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_resolve_all_async" ostree_repo_finder_resolve_all_async :: 
    Ptr (Ptr RepoFinder) ->                 -- finders : TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "RepoFinder"}))
    Ptr (Ptr OSTree.CollectionRef.CollectionRef) -> -- refs : TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "CollectionRef"}))
    Ptr OSTree.Repo.Repo ->                 -- parent_repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | A version of 'GI.OSTree.Interfaces.RepoFinder.repoFinderResolveAsync' which queries one or more
-- /@finders@/ in parallel and combines the results.
-- 
-- /Since: 2018.6/
repoFinderResolveAllAsync ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a, Gio.Cancellable.IsCancellable b) =>
    [RepoFinder]
    -- ^ /@finders@/: non-empty array of @/OstreeRepoFinders/@
    -> [OSTree.CollectionRef.CollectionRef]
    -- ^ /@refs@/: non-empty array of collection–ref pairs to find remotes for
    -> a
    -- ^ /@parentRepo@/: the local repository which the refs are being resolved for,
    --    which provides configuration information and GPG keys
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: asynchronous completion callback
    -> m ()
repoFinderResolveAllAsync :: [RepoFinder]
-> [CollectionRef]
-> a
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
repoFinderResolveAllAsync finders :: [RepoFinder]
finders refs :: [CollectionRef]
refs parentRepo :: a
parentRepo cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 RepoFinder]
finders' <- (RepoFinder -> IO (Ptr RepoFinder))
-> [RepoFinder] -> IO [Ptr RepoFinder]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RepoFinder -> IO (Ptr RepoFinder)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [RepoFinder]
finders
    Ptr (Ptr RepoFinder)
finders'' <- [Ptr RepoFinder] -> IO (Ptr (Ptr RepoFinder))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr RepoFinder]
finders'
    [Ptr CollectionRef]
refs' <- (CollectionRef -> IO (Ptr CollectionRef))
-> [CollectionRef] -> IO [Ptr CollectionRef]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM CollectionRef -> IO (Ptr CollectionRef)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [CollectionRef]
refs
    Ptr (Ptr CollectionRef)
refs'' <- [Ptr CollectionRef] -> IO (Ptr (Ptr CollectionRef))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr CollectionRef]
refs'
    Ptr Repo
parentRepo' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
parentRepo
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just jCancellable :: b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just jCallback :: AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr (Ptr RepoFinder)
-> Ptr (Ptr CollectionRef)
-> Ptr Repo
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
ostree_repo_finder_resolve_all_async Ptr (Ptr RepoFinder)
finders'' Ptr (Ptr CollectionRef)
refs'' Ptr Repo
parentRepo' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    (RepoFinder -> IO ()) -> [RepoFinder] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ RepoFinder -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [RepoFinder]
finders
    (CollectionRef -> IO ()) -> [CollectionRef] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ CollectionRef -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [CollectionRef]
refs
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
parentRepo
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr (Ptr RepoFinder) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr RepoFinder)
finders''
    Ptr (Ptr CollectionRef) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CollectionRef)
refs''
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif

-- method RepoFinder::resolve_all_finish
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#GAsyncResult from the callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TPtrArray
--                  (TInterface
--                     Name { namespace = "OSTree" , name = "RepoFinderResult" }))
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_finder_resolve_all_finish" ostree_repo_finder_resolve_all_finish :: 
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr (GPtrArray (Ptr OSTree.RepoFinderResult.RepoFinderResult)))

-- | Get the results from a 'GI.OSTree.Functions.repoFinderResolveAllAsync' operation.
-- 
-- /Since: 2018.6/
repoFinderResolveAllFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
    a
    -- ^ /@result@/: t'GI.Gio.Interfaces.AsyncResult.AsyncResult' from the callback
    -> m [OSTree.RepoFinderResult.RepoFinderResult]
    -- ^ __Returns:__ array of zero
    --    or more results /(Can throw 'Data.GI.Base.GError.GError')/
repoFinderResolveAllFinish :: a -> m [RepoFinderResult]
repoFinderResolveAllFinish result_ :: a
result_ = IO [RepoFinderResult] -> m [RepoFinderResult]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [RepoFinderResult] -> m [RepoFinderResult])
-> IO [RepoFinderResult] -> m [RepoFinderResult]
forall a b. (a -> b) -> a -> b
$ do
    Ptr AsyncResult
result_' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    IO [RepoFinderResult] -> IO () -> IO [RepoFinderResult]
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr (GPtrArray (Ptr RepoFinderResult))
result <- (Ptr (Ptr GError) -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
-> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
 -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
-> (Ptr (Ptr GError)
    -> IO (Ptr (GPtrArray (Ptr RepoFinderResult))))
-> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult
-> Ptr (Ptr GError) -> IO (Ptr (GPtrArray (Ptr RepoFinderResult)))
ostree_repo_finder_resolve_all_finish Ptr AsyncResult
result_'
        Text -> Ptr (GPtrArray (Ptr RepoFinderResult)) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "repoFinderResolveAllFinish" Ptr (GPtrArray (Ptr RepoFinderResult))
result
        [Ptr RepoFinderResult]
result' <- Ptr (GPtrArray (Ptr RepoFinderResult)) -> IO [Ptr RepoFinderResult]
forall a. Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unpackGPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
        [RepoFinderResult]
result'' <- (Ptr RepoFinderResult -> IO RepoFinderResult)
-> [Ptr RepoFinderResult] -> IO [RepoFinderResult]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr RepoFinderResult -> RepoFinderResult)
-> Ptr RepoFinderResult -> IO RepoFinderResult
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RepoFinderResult -> RepoFinderResult
OSTree.RepoFinderResult.RepoFinderResult) [Ptr RepoFinderResult]
result'
        Ptr (GPtrArray (Ptr RepoFinderResult)) -> IO ()
forall a. Ptr (GPtrArray a) -> IO ()
unrefPtrArray Ptr (GPtrArray (Ptr RepoFinderResult))
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
        [RepoFinderResult] -> IO [RepoFinderResult]
forall (m :: * -> *) a. Monad m => a -> m a
return [RepoFinderResult]
result''
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif