{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- 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.Objects.RepoFinderAvahi
    ( 

-- * Exported types
    RepoFinderAvahi(..)                     ,
    IsRepoFinderAvahi                       ,
    toRepoFinderAvahi                       ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [resolveAsync]("GI.OSTree.Interfaces.RepoFinder#g:method:resolveAsync"), [resolveFinish]("GI.OSTree.Interfaces.RepoFinder#g:method:resolveFinish"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [start]("GI.OSTree.Objects.RepoFinderAvahi#g:method:start"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [stop]("GI.OSTree.Objects.RepoFinderAvahi#g:method:stop"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveRepoFinderAvahiMethod            ,
#endif

-- ** new #method:new#

    repoFinderAvahiNew                      ,


-- ** start #method:start#

#if defined(ENABLE_OVERLOADING)
    RepoFinderAvahiStartMethodInfo          ,
#endif
    repoFinderAvahiStart                    ,


-- ** stop #method:stop#

#if defined(ENABLE_OVERLOADING)
    RepoFinderAvahiStopMethodInfo           ,
#endif
    repoFinderAvahiStop                     ,




    ) 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.GHashTable as B.GHT
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

import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder

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

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

foreign import ccall "ostree_repo_finder_avahi_get_type"
    c_ostree_repo_finder_avahi_get_type :: IO B.Types.GType

instance B.Types.TypedObject RepoFinderAvahi where
    glibType :: IO GType
glibType = IO GType
c_ostree_repo_finder_avahi_get_type

instance B.Types.GObject RepoFinderAvahi

-- | Type class for types which can be safely cast to `RepoFinderAvahi`, for instance with `toRepoFinderAvahi`.
class (SP.GObject o, O.IsDescendantOf RepoFinderAvahi o) => IsRepoFinderAvahi o
instance (SP.GObject o, O.IsDescendantOf RepoFinderAvahi o) => IsRepoFinderAvahi o

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

-- | Cast to `RepoFinderAvahi`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toRepoFinderAvahi :: (MIO.MonadIO m, IsRepoFinderAvahi o) => o -> m RepoFinderAvahi
toRepoFinderAvahi :: forall (m :: * -> *) o.
(MonadIO m, IsRepoFinderAvahi o) =>
o -> m RepoFinderAvahi
toRepoFinderAvahi = IO RepoFinderAvahi -> m RepoFinderAvahi
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO RepoFinderAvahi -> m RepoFinderAvahi)
-> (o -> IO RepoFinderAvahi) -> o -> m RepoFinderAvahi
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr RepoFinderAvahi -> RepoFinderAvahi)
-> o -> IO RepoFinderAvahi
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi

-- | Convert 'RepoFinderAvahi' 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 RepoFinderAvahi) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_repo_finder_avahi_get_type
    gvalueSet_ :: Ptr GValue -> Maybe RepoFinderAvahi -> IO ()
gvalueSet_ Ptr GValue
gv Maybe RepoFinderAvahi
P.Nothing = Ptr GValue -> Ptr RepoFinderAvahi -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr RepoFinderAvahi
forall a. Ptr a
FP.nullPtr :: FP.Ptr RepoFinderAvahi)
    gvalueSet_ Ptr GValue
gv (P.Just RepoFinderAvahi
obj) = RepoFinderAvahi -> (Ptr RepoFinderAvahi -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinderAvahi
obj (Ptr GValue -> Ptr RepoFinderAvahi -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe RepoFinderAvahi)
gvalueGet_ Ptr GValue
gv = do
        Ptr RepoFinderAvahi
ptr <- Ptr GValue -> IO (Ptr RepoFinderAvahi)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr RepoFinderAvahi)
        if Ptr RepoFinderAvahi
ptr Ptr RepoFinderAvahi -> Ptr RepoFinderAvahi -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr RepoFinderAvahi
forall a. Ptr a
FP.nullPtr
        then RepoFinderAvahi -> Maybe RepoFinderAvahi
forall a. a -> Maybe a
P.Just (RepoFinderAvahi -> Maybe RepoFinderAvahi)
-> IO RepoFinderAvahi -> IO (Maybe RepoFinderAvahi)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr RepoFinderAvahi -> RepoFinderAvahi)
-> Ptr RepoFinderAvahi -> IO RepoFinderAvahi
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi Ptr RepoFinderAvahi
ptr
        else Maybe RepoFinderAvahi -> IO (Maybe RepoFinderAvahi)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RepoFinderAvahi
forall a. Maybe a
P.Nothing
        
    

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

instance (info ~ ResolveRepoFinderAvahiMethod t RepoFinderAvahi, O.OverloadedMethod info RepoFinderAvahi p) => OL.IsLabel t (RepoFinderAvahi -> 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 ~ ResolveRepoFinderAvahiMethod t RepoFinderAvahi, O.OverloadedMethod info RepoFinderAvahi p, R.HasField t RepoFinderAvahi p) => R.HasField t RepoFinderAvahi p where
    getField = O.overloadedMethod @info

#endif

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

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

-- method RepoFinderAvahi::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "MainContext" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #GMainContext for processing Avahi\n   events in, or %NULL to use the current thread-default"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "RepoFinderAvahi" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_finder_avahi_new" ostree_repo_finder_avahi_new :: 
    Ptr GLib.MainContext.MainContext ->     -- context : TInterface (Name {namespace = "GLib", name = "MainContext"})
    IO (Ptr RepoFinderAvahi)

-- | Create a new t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi' instance. It is intended that one such
-- instance be created per process, and it be used to answer all resolution
-- requests from @/OstreeRepos/@.
-- 
-- The calling code is responsible for ensuring that /@context@/ is iterated while
-- the t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi' is running (after 'GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStart'
-- is called). This may be done from any thread.
-- 
-- If /@context@/ is 'P.Nothing', the current thread-default t'GI.GLib.Structs.MainContext.MainContext' is used.
-- 
-- /Since: 2018.6/
repoFinderAvahiNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Maybe (GLib.MainContext.MainContext)
    -- ^ /@context@/: a t'GI.GLib.Structs.MainContext.MainContext' for processing Avahi
    --    events in, or 'P.Nothing' to use the current thread-default
    -> m RepoFinderAvahi
    -- ^ __Returns:__ a new t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi'
repoFinderAvahiNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe MainContext -> m RepoFinderAvahi
repoFinderAvahiNew Maybe MainContext
context = IO RepoFinderAvahi -> m RepoFinderAvahi
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoFinderAvahi -> m RepoFinderAvahi)
-> IO RepoFinderAvahi -> m RepoFinderAvahi
forall a b. (a -> b) -> a -> b
$ do
    Ptr MainContext
maybeContext <- case Maybe MainContext
context of
        Maybe MainContext
Nothing -> Ptr MainContext -> IO (Ptr MainContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MainContext
forall a. Ptr a
nullPtr
        Just MainContext
jContext -> do
            Ptr MainContext
jContext' <- MainContext -> IO (Ptr MainContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MainContext
jContext
            Ptr MainContext -> IO (Ptr MainContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MainContext
jContext'
    Ptr RepoFinderAvahi
result <- Ptr MainContext -> IO (Ptr RepoFinderAvahi)
ostree_repo_finder_avahi_new Ptr MainContext
maybeContext
    Text -> Ptr RepoFinderAvahi -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoFinderAvahiNew" Ptr RepoFinderAvahi
result
    RepoFinderAvahi
result' <- ((ManagedPtr RepoFinderAvahi -> RepoFinderAvahi)
-> Ptr RepoFinderAvahi -> IO RepoFinderAvahi
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi) Ptr RepoFinderAvahi
result
    Maybe MainContext -> (MainContext -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe MainContext
context MainContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    RepoFinderAvahi -> IO RepoFinderAvahi
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return RepoFinderAvahi
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method RepoFinderAvahi::start
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFinderAvahi" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepoFinderAvahi"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_finder_avahi_start" ostree_repo_finder_avahi_start :: 
    Ptr RepoFinderAvahi ->                  -- self : TInterface (Name {namespace = "OSTree", name = "RepoFinderAvahi"})
    Ptr (Ptr GError) ->                     -- error
    IO ()

-- | Start monitoring the local network for peers who are advertising OSTree
-- repositories, using Avahi. In order for this to work, the t'GI.GLib.Structs.MainContext.MainContext'
-- passed to /@self@/ at construction time must be iterated (so it will typically
-- be the global t'GI.GLib.Structs.MainContext.MainContext', or be a separate t'GI.GLib.Structs.MainContext.MainContext' in a worker
-- thread).
-- 
-- This will return an error ('GI.Gio.Enums.IOErrorEnumFailed') if initialisation fails, or if
-- Avahi support is not available ('GI.Gio.Enums.IOErrorEnumNotSupported'). In either case,
-- the t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi' instance is useless afterwards and should be
-- destroyed.
-- 
-- Call 'GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStop' to stop the repo finder.
-- 
-- It is an error to call this function multiple times on the same
-- t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi' instance, or to call it after
-- 'GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStop'.
-- 
-- /Since: 2018.6/
repoFinderAvahiStart ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoFinderAvahiStart :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
a -> m ()
repoFinderAvahiStart a
self = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RepoFinderAvahi
self' <- a -> IO (Ptr RepoFinderAvahi)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        (Ptr (Ptr GError) -> IO ()) -> IO ()
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO ()) -> IO ())
-> (Ptr (Ptr GError) -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ Ptr RepoFinderAvahi -> Ptr (Ptr GError) -> IO ()
ostree_repo_finder_avahi_start Ptr RepoFinderAvahi
self'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoFinderAvahiStartMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepoFinderAvahi a) => O.OverloadedMethod RepoFinderAvahiStartMethodInfo a signature where
    overloadedMethod = repoFinderAvahiStart

instance O.OverloadedMethodInfo RepoFinderAvahiStartMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStart",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Objects-RepoFinderAvahi.html#v:repoFinderAvahiStart"
        })


#endif

-- method RepoFinderAvahi::stop
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFinderAvahi" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepoFinderAvahi"
--                 , 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_avahi_stop" ostree_repo_finder_avahi_stop :: 
    Ptr RepoFinderAvahi ->                  -- self : TInterface (Name {namespace = "OSTree", name = "RepoFinderAvahi"})
    IO ()

-- | Stop monitoring the local network for peers who are advertising OSTree
-- repositories. If any resolve tasks (from 'GI.OSTree.Interfaces.RepoFinder.repoFinderResolveAsync')
-- are in progress, they will be cancelled and will return 'GI.Gio.Enums.IOErrorEnumCancelled'.
-- 
-- Call 'GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStart' to start the repo finder.
-- 
-- It is an error to call this function multiple times on the same
-- t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi' instance, or to call it before
-- 'GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStart'.
-- 
-- /Since: 2018.6/
repoFinderAvahiStop ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi'
    -> m ()
repoFinderAvahiStop :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
a -> m ()
repoFinderAvahiStop a
self = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr RepoFinderAvahi
self' <- a -> IO (Ptr RepoFinderAvahi)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr RepoFinderAvahi -> IO ()
ostree_repo_finder_avahi_stop Ptr RepoFinderAvahi
self'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RepoFinderAvahiStopMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepoFinderAvahi a) => O.OverloadedMethod RepoFinderAvahiStopMethodInfo a signature where
    overloadedMethod = repoFinderAvahiStop

instance O.OverloadedMethodInfo RepoFinderAvahiStopMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStop",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Objects-RepoFinderAvahi.html#v:repoFinderAvahiStop"
        })


#endif