{-# LANGUAGE ImplicitParams, RankNTypes, 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.AsyncProgress
    ( 

-- * Exported types
    AsyncProgress(..)                       ,
    IsAsyncProgress                         ,
    toAsyncProgress                         ,


 -- * 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"), [copyState]("GI.OSTree.Objects.AsyncProgress#g:method:copyState"), [finish]("GI.OSTree.Objects.AsyncProgress#g:method:finish"), [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"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [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"), [getStatus]("GI.OSTree.Objects.AsyncProgress#g:method:getStatus"), [getUint]("GI.OSTree.Objects.AsyncProgress#g:method:getUint"), [getUint64]("GI.OSTree.Objects.AsyncProgress#g:method:getUint64"), [getVariant]("GI.OSTree.Objects.AsyncProgress#g:method:getVariant").
-- 
-- ==== 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"), [setStatus]("GI.OSTree.Objects.AsyncProgress#g:method:setStatus"), [setUint]("GI.OSTree.Objects.AsyncProgress#g:method:setUint"), [setUint64]("GI.OSTree.Objects.AsyncProgress#g:method:setUint64"), [setVariant]("GI.OSTree.Objects.AsyncProgress#g:method:setVariant").

#if defined(ENABLE_OVERLOADING)
    ResolveAsyncProgressMethod              ,
#endif

-- ** copyState #method:copyState#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressCopyStateMethodInfo        ,
#endif
    asyncProgressCopyState                  ,


-- ** finish #method:finish#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressFinishMethodInfo           ,
#endif
    asyncProgressFinish                     ,


-- ** getStatus #method:getStatus#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressGetStatusMethodInfo        ,
#endif
    asyncProgressGetStatus                  ,


-- ** getUint #method:getUint#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressGetUintMethodInfo          ,
#endif
    asyncProgressGetUint                    ,


-- ** getUint64 #method:getUint64#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressGetUint64MethodInfo        ,
#endif
    asyncProgressGetUint64                  ,


-- ** getVariant #method:getVariant#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressGetVariantMethodInfo       ,
#endif
    asyncProgressGetVariant                 ,


-- ** new #method:new#

    asyncProgressNew                        ,


-- ** setStatus #method:setStatus#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressSetStatusMethodInfo        ,
#endif
    asyncProgressSetStatus                  ,


-- ** setUint #method:setUint#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressSetUintMethodInfo          ,
#endif
    asyncProgressSetUint                    ,


-- ** setUint64 #method:setUint64#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressSetUint64MethodInfo        ,
#endif
    asyncProgressSetUint64                  ,


-- ** setVariant #method:setVariant#

#if defined(ENABLE_OVERLOADING)
    AsyncProgressSetVariantMethodInfo       ,
#endif
    asyncProgressSetVariant                 ,




 -- * Signals


-- ** changed #signal:changed#

    AsyncProgressChangedCallback            ,
#if defined(ENABLE_OVERLOADING)
    AsyncProgressChangedSignalInfo          ,
#endif
    afterAsyncProgressChanged               ,
    onAsyncProgressChanged                  ,




    ) 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.Kind as DK
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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.GObject.Objects.Object as GObject.Object

#else
import qualified GI.GObject.Objects.Object as GObject.Object

#endif

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

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

foreign import ccall "ostree_async_progress_get_type"
    c_ostree_async_progress_get_type :: IO B.Types.GType

instance B.Types.TypedObject AsyncProgress where
    glibType :: IO GType
glibType = IO GType
c_ostree_async_progress_get_type

instance B.Types.GObject AsyncProgress

-- | Type class for types which can be safely cast to t'AsyncProgress', for instance with `toAsyncProgress`.
class (SP.GObject o, O.IsDescendantOf AsyncProgress o) => IsAsyncProgress o
instance (SP.GObject o, O.IsDescendantOf AsyncProgress o) => IsAsyncProgress o

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

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

-- | Convert t'AsyncProgress' to and from t'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe AsyncProgress) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_async_progress_get_type
    gvalueSet_ :: Ptr GValue -> Maybe AsyncProgress -> IO ()
gvalueSet_ Ptr GValue
gv Maybe AsyncProgress
P.Nothing = Ptr GValue -> Ptr AsyncProgress -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr :: FP.Ptr AsyncProgress)
    gvalueSet_ Ptr GValue
gv (P.Just AsyncProgress
obj) = AsyncProgress -> (Ptr AsyncProgress -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AsyncProgress
obj (Ptr GValue -> Ptr AsyncProgress -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe AsyncProgress)
gvalueGet_ Ptr GValue
gv = do
        ptr <- Ptr GValue -> IO (Ptr AsyncProgress)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr AsyncProgress)
        if ptr /= FP.nullPtr
        then P.Just <$> B.ManagedPtr.newObject AsyncProgress ptr
        else return P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveAsyncProgressMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveAsyncProgressMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAsyncProgressMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAsyncProgressMethod "copyState" o = AsyncProgressCopyStateMethodInfo
    ResolveAsyncProgressMethod "finish" o = AsyncProgressFinishMethodInfo
    ResolveAsyncProgressMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAsyncProgressMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAsyncProgressMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveAsyncProgressMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAsyncProgressMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAsyncProgressMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAsyncProgressMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveAsyncProgressMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAsyncProgressMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAsyncProgressMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAsyncProgressMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAsyncProgressMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAsyncProgressMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveAsyncProgressMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAsyncProgressMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAsyncProgressMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAsyncProgressMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAsyncProgressMethod "getStatus" o = AsyncProgressGetStatusMethodInfo
    ResolveAsyncProgressMethod "getUint" o = AsyncProgressGetUintMethodInfo
    ResolveAsyncProgressMethod "getUint64" o = AsyncProgressGetUint64MethodInfo
    ResolveAsyncProgressMethod "getVariant" o = AsyncProgressGetVariantMethodInfo
    ResolveAsyncProgressMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAsyncProgressMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveAsyncProgressMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAsyncProgressMethod "setStatus" o = AsyncProgressSetStatusMethodInfo
    ResolveAsyncProgressMethod "setUint" o = AsyncProgressSetUintMethodInfo
    ResolveAsyncProgressMethod "setUint64" o = AsyncProgressSetUint64MethodInfo
    ResolveAsyncProgressMethod "setVariant" o = AsyncProgressSetVariantMethodInfo
    ResolveAsyncProgressMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- signal AsyncProgress::changed
-- | Emitted when /@self@/ has been changed.
type AsyncProgressChangedCallback =
    IO ()

type C_AsyncProgressChangedCallback =
    Ptr AsyncProgress ->                    -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_AsyncProgressChangedCallback`.
foreign import ccall "wrapper"
    mk_AsyncProgressChangedCallback :: C_AsyncProgressChangedCallback -> IO (FunPtr C_AsyncProgressChangedCallback)

wrap_AsyncProgressChangedCallback :: 
    GObject a => (a -> AsyncProgressChangedCallback) ->
    C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback a -> IO ()
gi'cb Ptr AsyncProgress
gi'selfPtr Ptr ()
_ = do
    Ptr AsyncProgress -> (AsyncProgress -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr AsyncProgress
gi'selfPtr ((AsyncProgress -> IO ()) -> IO ())
-> (AsyncProgress -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \AsyncProgress
gi'self -> a -> IO ()
gi'cb (AsyncProgress -> a
forall a b. Coercible a b => a -> b
Coerce.coerce AsyncProgress
gi'self) 


-- | Connect a signal handler for the [changed](#signal:changed) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' asyncProgress #changed callback
-- @
-- 
-- 
onAsyncProgressChanged :: (IsAsyncProgress a, MonadIO m) => a -> ((?self :: a) => AsyncProgressChangedCallback) -> m SignalHandlerId
onAsyncProgressChanged :: forall a (m :: * -> *).
(IsAsyncProgress a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onAsyncProgressChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_AsyncProgressChangedCallback
wrapped' = (a -> IO ()) -> C_AsyncProgressChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback a -> IO ()
wrapped
    wrapped'' <- C_AsyncProgressChangedCallback
-> IO (FunPtr C_AsyncProgressChangedCallback)
mk_AsyncProgressChangedCallback C_AsyncProgressChangedCallback
wrapped'
    connectSignalFunPtr obj "changed" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [changed](#signal:changed) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' asyncProgress #changed callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterAsyncProgressChanged :: (IsAsyncProgress a, MonadIO m) => a -> ((?self :: a) => AsyncProgressChangedCallback) -> m SignalHandlerId
afterAsyncProgressChanged :: forall a (m :: * -> *).
(IsAsyncProgress a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterAsyncProgressChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_AsyncProgressChangedCallback
wrapped' = (a -> IO ()) -> C_AsyncProgressChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_AsyncProgressChangedCallback
wrap_AsyncProgressChangedCallback a -> IO ()
wrapped
    wrapped'' <- C_AsyncProgressChangedCallback
-> IO (FunPtr C_AsyncProgressChangedCallback)
mk_AsyncProgressChangedCallback C_AsyncProgressChangedCallback
wrapped'
    connectSignalFunPtr obj "changed" wrapped'' SignalConnectAfter Nothing


#if defined(ENABLE_OVERLOADING)
data AsyncProgressChangedSignalInfo
instance SignalInfo AsyncProgressChangedSignalInfo where
    type HaskellCallbackType AsyncProgressChangedSignalInfo = AsyncProgressChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_AsyncProgressChangedCallback cb
        cb'' <- mk_AsyncProgressChangedCallback cb'
        connectSignalFunPtr obj "changed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.AsyncProgress::changed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-AsyncProgress.html#g:signal:changed"})

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AsyncProgress
type instance O.AttributeList AsyncProgress = AsyncProgressAttributeList
type AsyncProgressAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AsyncProgress = AsyncProgressSignalList
type AsyncProgressSignalList = ('[ '("changed", AsyncProgressChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method AsyncProgress::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "OSTree" , name = "AsyncProgress" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_new" ostree_async_progress_new :: 
    IO (Ptr AsyncProgress)

-- | /No description available in the introspection data./
asyncProgressNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m AsyncProgress
    -- ^ __Returns:__ A new progress object
asyncProgressNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m AsyncProgress
asyncProgressNew  = IO AsyncProgress -> m AsyncProgress
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AsyncProgress -> m AsyncProgress)
-> IO AsyncProgress -> m AsyncProgress
forall a b. (a -> b) -> a -> b
$ do
    result <- IO (Ptr AsyncProgress)
ostree_async_progress_new
    checkUnexpectedReturnNULL "asyncProgressNew" result
    result' <- (wrapObject AsyncProgress) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method AsyncProgress::copy_state
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeAsyncProgress to copy from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dest"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeAsyncProgress to copy to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_copy_state" ostree_async_progress_copy_state :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    Ptr AsyncProgress ->                    -- dest : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    IO ()

-- | Atomically copies all the state from /@self@/ to /@dest@/, without invoking the
-- callback.
-- This is used for proxying progress objects across different @/GMainContexts/@.
-- 
-- /Since: 2019.6/
asyncProgressCopyState ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a, IsAsyncProgress b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.AsyncProgress.AsyncProgress' to copy from
    -> b
    -- ^ /@dest@/: An t'GI.OSTree.Objects.AsyncProgress.AsyncProgress' to copy to
    -> m ()
asyncProgressCopyState :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAsyncProgress a, IsAsyncProgress b) =>
a -> b -> m ()
asyncProgressCopyState a
self b
dest = 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
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    dest' <- unsafeManagedPtrCastPtr dest
    ostree_async_progress_copy_state self' dest'
    touchManagedPtr self
    touchManagedPtr dest
    return ()

#if defined(ENABLE_OVERLOADING)
data AsyncProgressCopyStateMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsAsyncProgress a, IsAsyncProgress b) => O.OverloadedMethod AsyncProgressCopyStateMethodInfo a signature where
    overloadedMethod = asyncProgressCopyState

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


#endif

-- method AsyncProgress::finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_finish" ostree_async_progress_finish :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    IO ()

-- | Process any pending signals, ensuring the main context is cleared
-- of sources used by this object.  Also ensures that no further
-- events will be queued.
asyncProgressFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -- ^ /@self@/: Self
    -> m ()
asyncProgressFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> m ()
asyncProgressFinish 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
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    ostree_async_progress_finish self'
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data AsyncProgressFinishMethodInfo
instance (signature ~ (m ()), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressFinishMethodInfo a signature where
    overloadedMethod = asyncProgressFinish

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


#endif

-- method AsyncProgress::get_status
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeAsyncProgress"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_get_status" ostree_async_progress_get_status :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    IO CString

-- | Get the human-readable status string from the t'GI.OSTree.Objects.AsyncProgress.AsyncProgress'. This
-- operation is thread-safe. The retuned value may be 'P.Nothing' if no status is
-- set.
-- 
-- This is a convenience function to get the well-known @status@ key.
-- 
-- /Since: 2017.6/
asyncProgressGetStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.AsyncProgress.AsyncProgress'
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the current status, or 'P.Nothing' if none is set
asyncProgressGetStatus :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> m (Maybe Text)
asyncProgressGetStatus a
self = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
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
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_async_progress_get_status self'
    maybeResult <- convertIfNonNull result $ \CString
result' -> do
        result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        freeMem result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetStatusMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressGetStatusMethodInfo a signature where
    overloadedMethod = asyncProgressGetStatus

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


#endif

-- method AsyncProgress::get_uint
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_get_uint" ostree_async_progress_get_uint :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    CString ->                              -- key : TBasicType TUTF8
    IO Word32

-- | /No description available in the introspection data./
asyncProgressGetUint ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -> T.Text
    -> m Word32
asyncProgressGetUint :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Text -> m Word32
asyncProgressGetUint a
self Text
key = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    result <- ostree_async_progress_get_uint self' key'
    touchManagedPtr self
    freeMem key'
    return result

#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetUintMethodInfo
instance (signature ~ (T.Text -> m Word32), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressGetUintMethodInfo a signature where
    overloadedMethod = asyncProgressGetUint

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


#endif

-- method AsyncProgress::get_uint64
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_get_uint64" ostree_async_progress_get_uint64 :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    CString ->                              -- key : TBasicType TUTF8
    IO Word64

-- | /No description available in the introspection data./
asyncProgressGetUint64 ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -> T.Text
    -> m Word64
asyncProgressGetUint64 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Text -> m Word64
asyncProgressGetUint64 a
self Text
key = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    result <- ostree_async_progress_get_uint64 self' key'
    touchManagedPtr self
    freeMem key'
    return result

#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetUint64MethodInfo
instance (signature ~ (T.Text -> m Word64), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressGetUint64MethodInfo a signature where
    overloadedMethod = asyncProgressGetUint64

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


#endif

-- method AsyncProgress::get_variant
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeAsyncProgress"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a key to look up" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just TVariant
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_get_variant" ostree_async_progress_get_variant :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    CString ->                              -- key : TBasicType TUTF8
    IO (Ptr GVariant)

-- | Look up a key in the t'GI.OSTree.Objects.AsyncProgress.AsyncProgress' and return the t'GVariant' associated
-- with it. The lookup is thread-safe.
-- 
-- /Since: 2017.6/
asyncProgressGetVariant ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.AsyncProgress.AsyncProgress'
    -> T.Text
    -- ^ /@key@/: a key to look up
    -> m (Maybe GVariant)
    -- ^ __Returns:__ value for the given /@key@/, or 'P.Nothing' if
    --    it was not set
asyncProgressGetVariant :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Text -> m (Maybe GVariant)
asyncProgressGetVariant a
self Text
key = IO (Maybe GVariant) -> m (Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    result <- ostree_async_progress_get_variant self' key'
    maybeResult <- convertIfNonNull result $ \Ptr GVariant
result' -> do
        result'' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
result'
        return result''
    touchManagedPtr self
    freeMem key'
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data AsyncProgressGetVariantMethodInfo
instance (signature ~ (T.Text -> m (Maybe GVariant)), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressGetVariantMethodInfo a signature where
    overloadedMethod = asyncProgressGetVariant

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


#endif

-- method AsyncProgress::set_status
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeAsyncProgress"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "status"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "new status string, or %NULL to clear the status"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_set_status" ostree_async_progress_set_status :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    CString ->                              -- status : TBasicType TUTF8
    IO ()

-- | Set the human-readable status string for the t'GI.OSTree.Objects.AsyncProgress.AsyncProgress'. This
-- operation is thread-safe. 'P.Nothing' may be passed to clear the status.
-- 
-- This is a convenience function to set the well-known @status@ key.
-- 
-- /Since: 2017.6/
asyncProgressSetStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.AsyncProgress.AsyncProgress'
    -> Maybe (T.Text)
    -- ^ /@status@/: new status string, or 'P.Nothing' to clear the status
    -> m ()
asyncProgressSetStatus :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Maybe Text -> m ()
asyncProgressSetStatus a
self Maybe Text
status = 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
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeStatus <- case status of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jStatus -> do
            jStatus' <- Text -> IO CString
textToCString Text
jStatus
            return jStatus'
    ostree_async_progress_set_status self' maybeStatus
    touchManagedPtr self
    freeMem maybeStatus
    return ()

#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetStatusMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressSetStatusMethodInfo a signature where
    overloadedMethod = asyncProgressSetStatus

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


#endif

-- method AsyncProgress::set_uint
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt
--           , argCType = Just "guint"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_set_uint" ostree_async_progress_set_uint :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    CString ->                              -- key : TBasicType TUTF8
    Word32 ->                               -- value : TBasicType TUInt
    IO ()

-- | /No description available in the introspection data./
asyncProgressSetUint ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -> T.Text
    -> Word32
    -> m ()
asyncProgressSetUint :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Text -> Word32 -> m ()
asyncProgressSetUint a
self Text
key Word32
value = 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
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    ostree_async_progress_set_uint self' key' value
    touchManagedPtr self
    freeMem key'
    return ()

#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetUintMethodInfo
instance (signature ~ (T.Text -> Word32 -> m ()), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressSetUintMethodInfo a signature where
    overloadedMethod = asyncProgressSetUint

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


#endif

-- method AsyncProgress::set_uint64
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_set_uint64" ostree_async_progress_set_uint64 :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    CString ->                              -- key : TBasicType TUTF8
    Word64 ->                               -- value : TBasicType TUInt64
    IO ()

-- | /No description available in the introspection data./
asyncProgressSetUint64 ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -> T.Text
    -> Word64
    -> m ()
asyncProgressSetUint64 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Text -> Word64 -> m ()
asyncProgressSetUint64 a
self Text
key Word64
value = 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
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    ostree_async_progress_set_uint64 self' key' value
    touchManagedPtr self
    freeMem key'
    return ()

#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetUint64MethodInfo
instance (signature ~ (T.Text -> Word64 -> m ()), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressSetUint64MethodInfo a signature where
    overloadedMethod = asyncProgressSetUint64

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


#endif

-- method AsyncProgress::set_variant
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeAsyncProgress"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a key to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to assign to @key"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_async_progress_set_variant" ostree_async_progress_set_variant :: 
    Ptr AsyncProgress ->                    -- self : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    CString ->                              -- key : TBasicType TUTF8
    Ptr GVariant ->                         -- value : TVariant
    IO ()

-- | Assign a new /@value@/ to the given /@key@/, replacing any existing value. The
-- operation is thread-safe. /@value@/ may be a floating reference;
-- 'GI.GLib.Structs.Variant.variantRefSink' will be called on it.
-- 
-- Any watchers of the t'GI.OSTree.Objects.AsyncProgress.AsyncProgress' will be notified of the change if
-- /@value@/ differs from the existing value for /@key@/.
-- 
-- /Since: 2017.6/
asyncProgressSetVariant ::
    (B.CallStack.HasCallStack, MonadIO m, IsAsyncProgress a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.AsyncProgress.AsyncProgress'
    -> T.Text
    -- ^ /@key@/: a key to set
    -> GVariant
    -- ^ /@value@/: the value to assign to /@key@/
    -> m ()
asyncProgressSetVariant :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Text -> GVariant -> m ()
asyncProgressSetVariant a
self Text
key GVariant
value = 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
    self' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    value' <- unsafeManagedPtrGetPtr value
    ostree_async_progress_set_variant self' key' value'
    touchManagedPtr self
    touchManagedPtr value
    freeMem key'
    return ()

#if defined(ENABLE_OVERLOADING)
data AsyncProgressSetVariantMethodInfo
instance (signature ~ (T.Text -> GVariant -> m ()), MonadIO m, IsAsyncProgress a) => O.OverloadedMethod AsyncProgressSetVariantMethodInfo a signature where
    overloadedMethod = asyncProgressSetVariant

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


#endif