{-# 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.SysrootUpgrader
    ( 

-- * Exported types
    SysrootUpgrader(..)                     ,
    IsSysrootUpgrader                       ,
    toSysrootUpgrader                       ,


 -- * 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"), [deploy]("GI.OSTree.Objects.SysrootUpgrader#g:method:deploy"), [dupOrigin]("GI.OSTree.Objects.SysrootUpgrader#g:method:dupOrigin"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [init]("GI.Gio.Interfaces.Initable#g:method:init"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [pull]("GI.OSTree.Objects.SysrootUpgrader#g:method:pull"), [pullOneDir]("GI.OSTree.Objects.SysrootUpgrader#g:method:pullOneDir"), [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"), [getOrigin]("GI.OSTree.Objects.SysrootUpgrader#g:method:getOrigin"), [getOriginDescription]("GI.OSTree.Objects.SysrootUpgrader#g:method:getOriginDescription"), [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"), [setOrigin]("GI.OSTree.Objects.SysrootUpgrader#g:method:setOrigin"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveSysrootUpgraderMethod            ,
#endif

-- ** checkTimestamps #method:checkTimestamps#

    sysrootUpgraderCheckTimestamps          ,


-- ** deploy #method:deploy#

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderDeployMethodInfo         ,
#endif
    sysrootUpgraderDeploy                   ,


-- ** dupOrigin #method:dupOrigin#

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderDupOriginMethodInfo      ,
#endif
    sysrootUpgraderDupOrigin                ,


-- ** getOrigin #method:getOrigin#

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderGetOriginMethodInfo      ,
#endif
    sysrootUpgraderGetOrigin                ,


-- ** getOriginDescription #method:getOriginDescription#

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderGetOriginDescriptionMethodInfo,
#endif
    sysrootUpgraderGetOriginDescription     ,


-- ** new #method:new#

    sysrootUpgraderNew                      ,


-- ** newForOs #method:newForOs#

    sysrootUpgraderNewForOs                 ,


-- ** newForOsWithFlags #method:newForOsWithFlags#

    sysrootUpgraderNewForOsWithFlags        ,


-- ** pull #method:pull#

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderPullMethodInfo           ,
#endif
    sysrootUpgraderPull                     ,


-- ** pullOneDir #method:pullOneDir#

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderPullOneDirMethodInfo     ,
#endif
    sysrootUpgraderPullOneDir               ,


-- ** setOrigin #method:setOrigin#

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderSetOriginMethodInfo      ,
#endif
    sysrootUpgraderSetOrigin                ,




 -- * Properties


-- ** flags #attr:flags#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderFlagsPropertyInfo        ,
#endif
    constructSysrootUpgraderFlags           ,
    getSysrootUpgraderFlags                 ,
#if defined(ENABLE_OVERLOADING)
    sysrootUpgraderFlags                    ,
#endif


-- ** osname #attr:osname#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderOsnamePropertyInfo       ,
#endif
    constructSysrootUpgraderOsname          ,
    getSysrootUpgraderOsname                ,
#if defined(ENABLE_OVERLOADING)
    sysrootUpgraderOsname                   ,
#endif


-- ** sysroot #attr:sysroot#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SysrootUpgraderSysrootPropertyInfo      ,
#endif
    constructSysrootUpgraderSysroot         ,
    getSysrootUpgraderSysroot               ,
#if defined(ENABLE_OVERLOADING)
    sysrootUpgraderSysroot                  ,
#endif




    ) 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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.OSTree.Callbacks as OSTree.Callbacks
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.BlobReader as OSTree.BlobReader
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.Sign as OSTree.Sign
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.BootconfigParser as OSTree.BootconfigParser
import {-# SOURCE #-} qualified GI.OSTree.Objects.ContentWriter as OSTree.ContentWriter
import {-# SOURCE #-} qualified GI.OSTree.Objects.Deployment as OSTree.Deployment
import {-# SOURCE #-} qualified GI.OSTree.Objects.GpgVerifyResult as OSTree.GpgVerifyResult
import {-# SOURCE #-} qualified GI.OSTree.Objects.MutableTree as OSTree.MutableTree
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Objects.RepoFile as OSTree.RepoFile
import {-# SOURCE #-} qualified GI.OSTree.Objects.SePolicy as OSTree.SePolicy
import {-# SOURCE #-} qualified GI.OSTree.Objects.Sysroot as OSTree.Sysroot
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCheckoutAtOptions as OSTree.RepoCheckoutAtOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCommitModifier as OSTree.RepoCommitModifier
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoDevInoCache as OSTree.RepoDevInoCache
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats
import {-# SOURCE #-} qualified GI.OSTree.Structs.SysrootDeployTreeOpts as OSTree.SysrootDeployTreeOpts
import {-# SOURCE #-} qualified GI.OSTree.Structs.SysrootWriteDeploymentsOpts as OSTree.SysrootWriteDeploymentsOpts

#else
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Objects.Sysroot as OSTree.Sysroot

#endif

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

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

foreign import ccall "ostree_sysroot_upgrader_get_type"
    c_ostree_sysroot_upgrader_get_type :: IO B.Types.GType

instance B.Types.TypedObject SysrootUpgrader where
    glibType :: IO GType
glibType = IO GType
c_ostree_sysroot_upgrader_get_type

instance B.Types.GObject SysrootUpgrader

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

instance O.HasParentTypes SysrootUpgrader
type instance O.ParentTypes SysrootUpgrader = '[GObject.Object.Object, Gio.Initable.Initable]

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveSysrootUpgraderMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSysrootUpgraderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSysrootUpgraderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSysrootUpgraderMethod "deploy" o = SysrootUpgraderDeployMethodInfo
    ResolveSysrootUpgraderMethod "dupOrigin" o = SysrootUpgraderDupOriginMethodInfo
    ResolveSysrootUpgraderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSysrootUpgraderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSysrootUpgraderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSysrootUpgraderMethod "init" o = Gio.Initable.InitableInitMethodInfo
    ResolveSysrootUpgraderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSysrootUpgraderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSysrootUpgraderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSysrootUpgraderMethod "pull" o = SysrootUpgraderPullMethodInfo
    ResolveSysrootUpgraderMethod "pullOneDir" o = SysrootUpgraderPullOneDirMethodInfo
    ResolveSysrootUpgraderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSysrootUpgraderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSysrootUpgraderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSysrootUpgraderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSysrootUpgraderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSysrootUpgraderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSysrootUpgraderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSysrootUpgraderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSysrootUpgraderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSysrootUpgraderMethod "getOrigin" o = SysrootUpgraderGetOriginMethodInfo
    ResolveSysrootUpgraderMethod "getOriginDescription" o = SysrootUpgraderGetOriginDescriptionMethodInfo
    ResolveSysrootUpgraderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSysrootUpgraderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSysrootUpgraderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSysrootUpgraderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSysrootUpgraderMethod "setOrigin" o = SysrootUpgraderSetOriginMethodInfo
    ResolveSysrootUpgraderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSysrootUpgraderMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- VVV Prop "flags"
   -- Type: TInterface (Name {namespace = "OSTree", name = "SysrootUpgraderFlags"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@flags@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' sysrootUpgrader #flags
-- @
getSysrootUpgraderFlags :: (MonadIO m, IsSysrootUpgrader o) => o -> m [OSTree.Flags.SysrootUpgraderFlags]
getSysrootUpgraderFlags :: forall (m :: * -> *) o.
(MonadIO m, IsSysrootUpgrader o) =>
o -> m [SysrootUpgraderFlags]
getSysrootUpgraderFlags o
obj = IO [SysrootUpgraderFlags] -> m [SysrootUpgraderFlags]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO [SysrootUpgraderFlags] -> m [SysrootUpgraderFlags])
-> IO [SysrootUpgraderFlags] -> m [SysrootUpgraderFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [SysrootUpgraderFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"flags"

-- | Construct a t'GValueConstruct' with valid value for the “@flags@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSysrootUpgraderFlags :: (IsSysrootUpgrader o, MIO.MonadIO m) => [OSTree.Flags.SysrootUpgraderFlags] -> m (GValueConstruct o)
constructSysrootUpgraderFlags :: forall o (m :: * -> *).
(IsSysrootUpgrader o, MonadIO m) =>
[SysrootUpgraderFlags] -> m (GValueConstruct o)
constructSysrootUpgraderFlags [SysrootUpgraderFlags]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [SysrootUpgraderFlags] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"flags" [SysrootUpgraderFlags]
val

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderFlagsPropertyInfo
instance AttrInfo SysrootUpgraderFlagsPropertyInfo where
    type AttrAllowedOps SysrootUpgraderFlagsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SysrootUpgraderFlagsPropertyInfo = IsSysrootUpgrader
    type AttrSetTypeConstraint SysrootUpgraderFlagsPropertyInfo = (~) [OSTree.Flags.SysrootUpgraderFlags]
    type AttrTransferTypeConstraint SysrootUpgraderFlagsPropertyInfo = (~) [OSTree.Flags.SysrootUpgraderFlags]
    type AttrTransferType SysrootUpgraderFlagsPropertyInfo = [OSTree.Flags.SysrootUpgraderFlags]
    type AttrGetType SysrootUpgraderFlagsPropertyInfo = [OSTree.Flags.SysrootUpgraderFlags]
    type AttrLabel SysrootUpgraderFlagsPropertyInfo = "flags"
    type AttrOrigin SysrootUpgraderFlagsPropertyInfo = SysrootUpgrader
    attrGet = getSysrootUpgraderFlags
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructSysrootUpgraderFlags
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.SysrootUpgrader.flags"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SysrootUpgrader.html#g:attr:flags"
        })
#endif

-- VVV Prop "osname"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@osname@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' sysrootUpgrader #osname
-- @
getSysrootUpgraderOsname :: (MonadIO m, IsSysrootUpgrader o) => o -> m (Maybe T.Text)
getSysrootUpgraderOsname :: forall (m :: * -> *) o.
(MonadIO m, IsSysrootUpgrader o) =>
o -> m (Maybe Text)
getSysrootUpgraderOsname o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"osname"

-- | Construct a t'GValueConstruct' with valid value for the “@osname@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSysrootUpgraderOsname :: (IsSysrootUpgrader o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructSysrootUpgraderOsname :: forall o (m :: * -> *).
(IsSysrootUpgrader o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructSysrootUpgraderOsname Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"osname" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderOsnamePropertyInfo
instance AttrInfo SysrootUpgraderOsnamePropertyInfo where
    type AttrAllowedOps SysrootUpgraderOsnamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SysrootUpgraderOsnamePropertyInfo = IsSysrootUpgrader
    type AttrSetTypeConstraint SysrootUpgraderOsnamePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint SysrootUpgraderOsnamePropertyInfo = (~) T.Text
    type AttrTransferType SysrootUpgraderOsnamePropertyInfo = T.Text
    type AttrGetType SysrootUpgraderOsnamePropertyInfo = (Maybe T.Text)
    type AttrLabel SysrootUpgraderOsnamePropertyInfo = "osname"
    type AttrOrigin SysrootUpgraderOsnamePropertyInfo = SysrootUpgrader
    attrGet = getSysrootUpgraderOsname
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructSysrootUpgraderOsname
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.SysrootUpgrader.osname"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SysrootUpgrader.html#g:attr:osname"
        })
#endif

-- VVV Prop "sysroot"
   -- Type: TInterface (Name {namespace = "OSTree", name = "Sysroot"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@sysroot@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' sysrootUpgrader #sysroot
-- @
getSysrootUpgraderSysroot :: (MonadIO m, IsSysrootUpgrader o) => o -> m (Maybe OSTree.Sysroot.Sysroot)
getSysrootUpgraderSysroot :: forall (m :: * -> *) o.
(MonadIO m, IsSysrootUpgrader o) =>
o -> m (Maybe Sysroot)
getSysrootUpgraderSysroot o
obj = IO (Maybe Sysroot) -> m (Maybe Sysroot)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Sysroot) -> m (Maybe Sysroot))
-> IO (Maybe Sysroot) -> m (Maybe Sysroot)
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Sysroot -> Sysroot) -> IO (Maybe Sysroot)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"sysroot" ManagedPtr Sysroot -> Sysroot
OSTree.Sysroot.Sysroot

-- | Construct a t'GValueConstruct' with valid value for the “@sysroot@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSysrootUpgraderSysroot :: (IsSysrootUpgrader o, MIO.MonadIO m, OSTree.Sysroot.IsSysroot a) => a -> m (GValueConstruct o)
constructSysrootUpgraderSysroot :: forall o (m :: * -> *) a.
(IsSysrootUpgrader o, MonadIO m, IsSysroot a) =>
a -> m (GValueConstruct o)
constructSysrootUpgraderSysroot a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"sysroot" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderSysrootPropertyInfo
instance AttrInfo SysrootUpgraderSysrootPropertyInfo where
    type AttrAllowedOps SysrootUpgraderSysrootPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SysrootUpgraderSysrootPropertyInfo = IsSysrootUpgrader
    type AttrSetTypeConstraint SysrootUpgraderSysrootPropertyInfo = OSTree.Sysroot.IsSysroot
    type AttrTransferTypeConstraint SysrootUpgraderSysrootPropertyInfo = OSTree.Sysroot.IsSysroot
    type AttrTransferType SysrootUpgraderSysrootPropertyInfo = OSTree.Sysroot.Sysroot
    type AttrGetType SysrootUpgraderSysrootPropertyInfo = (Maybe OSTree.Sysroot.Sysroot)
    type AttrLabel SysrootUpgraderSysrootPropertyInfo = "sysroot"
    type AttrOrigin SysrootUpgraderSysrootPropertyInfo = SysrootUpgrader
    attrGet = getSysrootUpgraderSysroot
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        unsafeCastTo OSTree.Sysroot.Sysroot v
    attrConstruct = constructSysrootUpgraderSysroot
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.SysrootUpgrader.sysroot"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-SysrootUpgrader.html#g:attr:sysroot"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SysrootUpgrader
type instance O.AttributeList SysrootUpgrader = SysrootUpgraderAttributeList
type SysrootUpgraderAttributeList = ('[ '("flags", SysrootUpgraderFlagsPropertyInfo), '("osname", SysrootUpgraderOsnamePropertyInfo), '("sysroot", SysrootUpgraderSysrootPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
sysrootUpgraderFlags :: AttrLabelProxy "flags"
sysrootUpgraderFlags = AttrLabelProxy

sysrootUpgraderOsname :: AttrLabelProxy "osname"
sysrootUpgraderOsname = AttrLabelProxy

sysrootUpgraderSysroot :: AttrLabelProxy "sysroot"
sysrootUpgraderSysroot = AttrLabelProxy

#endif

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

#endif

-- method SysrootUpgrader::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "sysroot"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sysroot" }
--           , argCType = Just "OstreeSysroot*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeSysroot" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "SysrootUpgrader" })
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_new" ostree_sysroot_upgrader_new :: 
    Ptr OSTree.Sysroot.Sysroot ->           -- sysroot : TInterface (Name {namespace = "OSTree", name = "Sysroot"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr SysrootUpgrader)

-- | /No description available in the introspection data./
sysrootUpgraderNew ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Sysroot.IsSysroot a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@sysroot@/: An t'GI.OSTree.Objects.Sysroot.Sysroot'
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m SysrootUpgrader
    -- ^ __Returns:__ An upgrader /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderNew :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) =>
a -> Maybe b -> m SysrootUpgrader
sysrootUpgraderNew a
sysroot Maybe b
cancellable = IO SysrootUpgrader -> m SysrootUpgrader
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SysrootUpgrader -> m SysrootUpgrader)
-> IO SysrootUpgrader -> m SysrootUpgrader
forall a b. (a -> b) -> a -> b
$ do
    sysroot' <- a -> IO (Ptr Sysroot)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sysroot
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_sysroot_upgrader_new sysroot' maybeCancellable
        checkUnexpectedReturnNULL "sysrootUpgraderNew" result
        result' <- (wrapObject SysrootUpgrader) result
        touchManagedPtr sysroot
        whenJust cancellable touchManagedPtr
        return result'
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method SysrootUpgrader::new_for_os
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "sysroot"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sysroot" }
--           , argCType = Just "OstreeSysroot*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeSysroot" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "osname"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Operating system name"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "SysrootUpgrader" })
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_new_for_os" ostree_sysroot_upgrader_new_for_os :: 
    Ptr OSTree.Sysroot.Sysroot ->           -- sysroot : TInterface (Name {namespace = "OSTree", name = "Sysroot"})
    CString ->                              -- osname : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr SysrootUpgrader)

-- | /No description available in the introspection data./
sysrootUpgraderNewForOs ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Sysroot.IsSysroot a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@sysroot@/: An t'GI.OSTree.Objects.Sysroot.Sysroot'
    -> Maybe (T.Text)
    -- ^ /@osname@/: Operating system name
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m SysrootUpgrader
    -- ^ __Returns:__ An upgrader /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderNewForOs :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) =>
a -> Maybe Text -> Maybe b -> m SysrootUpgrader
sysrootUpgraderNewForOs a
sysroot Maybe Text
osname Maybe b
cancellable = IO SysrootUpgrader -> m SysrootUpgrader
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SysrootUpgrader -> m SysrootUpgrader)
-> IO SysrootUpgrader -> m SysrootUpgrader
forall a b. (a -> b) -> a -> b
$ do
    sysroot' <- a -> IO (Ptr Sysroot)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sysroot
    maybeOsname <- case osname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
FP.nullPtr
        Just Text
jOsname -> do
            jOsname' <- Text -> IO (Ptr CChar)
textToCString Text
jOsname
            return jOsname'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_sysroot_upgrader_new_for_os sysroot' maybeOsname maybeCancellable
        checkUnexpectedReturnNULL "sysrootUpgraderNewForOs" result
        result' <- (wrapObject SysrootUpgrader) result
        touchManagedPtr sysroot
        whenJust cancellable touchManagedPtr
        freeMem maybeOsname
        return result'
     ) (do
        freeMem maybeOsname
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method SysrootUpgrader::new_for_os_with_flags
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "sysroot"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sysroot" }
--           , argCType = Just "OstreeSysroot*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeSysroot" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "osname"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Operating system name"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "SysrootUpgraderFlags" }
--           , argCType = Just "OstreeSysrootUpgraderFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Flags" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "OSTree" , name = "SysrootUpgrader" })
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_new_for_os_with_flags" ostree_sysroot_upgrader_new_for_os_with_flags :: 
    Ptr OSTree.Sysroot.Sysroot ->           -- sysroot : TInterface (Name {namespace = "OSTree", name = "Sysroot"})
    CString ->                              -- osname : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "SysrootUpgraderFlags"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr SysrootUpgrader)

-- | /No description available in the introspection data./
sysrootUpgraderNewForOsWithFlags ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Sysroot.IsSysroot a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@sysroot@/: An t'GI.OSTree.Objects.Sysroot.Sysroot'
    -> Maybe (T.Text)
    -- ^ /@osname@/: Operating system name
    -> [OSTree.Flags.SysrootUpgraderFlags]
    -- ^ /@flags@/: Flags
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m SysrootUpgrader
    -- ^ __Returns:__ An upgrader /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderNewForOsWithFlags :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSysroot a, IsCancellable b) =>
a
-> Maybe Text
-> [SysrootUpgraderFlags]
-> Maybe b
-> m SysrootUpgrader
sysrootUpgraderNewForOsWithFlags a
sysroot Maybe Text
osname [SysrootUpgraderFlags]
flags Maybe b
cancellable = IO SysrootUpgrader -> m SysrootUpgrader
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SysrootUpgrader -> m SysrootUpgrader)
-> IO SysrootUpgrader -> m SysrootUpgrader
forall a b. (a -> b) -> a -> b
$ do
    sysroot' <- a -> IO (Ptr Sysroot)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
sysroot
    maybeOsname <- case osname of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
FP.nullPtr
        Just Text
jOsname -> do
            jOsname' <- Text -> IO (Ptr CChar)
textToCString Text
jOsname
            return jOsname'
    let flags' = [SysrootUpgraderFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SysrootUpgraderFlags]
flags
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_sysroot_upgrader_new_for_os_with_flags sysroot' maybeOsname flags' maybeCancellable
        checkUnexpectedReturnNULL "sysrootUpgraderNewForOsWithFlags" result
        result' <- (wrapObject SysrootUpgrader) result
        touchManagedPtr sysroot
        whenJust cancellable touchManagedPtr
        freeMem maybeOsname
        return result'
     ) (do
        freeMem maybeOsname
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method SysrootUpgrader::deploy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "SysrootUpgrader" }
--           , argCType = Just "OstreeSysrootUpgrader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_deploy" ostree_sysroot_upgrader_deploy :: 
    Ptr SysrootUpgrader ->                  -- self : TInterface (Name {namespace = "OSTree", name = "SysrootUpgrader"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Write the new deployment to disk, perform a configuration merge
-- with \/etc, and update the bootloader configuration.
sysrootUpgraderDeploy ::
    (B.CallStack.HasCallStack, MonadIO m, IsSysrootUpgrader a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: Self
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderDeploy :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSysrootUpgrader a, IsCancellable b) =>
a -> Maybe b -> m ()
sysrootUpgraderDeploy a
self Maybe b
cancellable = 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 SysrootUpgrader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sysroot_upgrader_deploy self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderDeployMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSysrootUpgrader a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SysrootUpgraderDeployMethodInfo a signature where
    overloadedMethod = sysrootUpgraderDeploy

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


#endif

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

foreign import ccall "ostree_sysroot_upgrader_dup_origin" ostree_sysroot_upgrader_dup_origin :: 
    Ptr SysrootUpgrader ->                  -- self : TInterface (Name {namespace = "OSTree", name = "SysrootUpgrader"})
    IO (Ptr GLib.KeyFile.KeyFile)

-- | /No description available in the introspection data./
sysrootUpgraderDupOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsSysrootUpgrader a) =>
    a
    -- ^ /@self@/: Sysroot
    -> m (Maybe GLib.KeyFile.KeyFile)
    -- ^ __Returns:__ A copy of the origin file, or 'P.Nothing' if unknown.
sysrootUpgraderDupOrigin :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSysrootUpgrader a) =>
a -> m (Maybe KeyFile)
sysrootUpgraderDupOrigin a
self = IO (Maybe KeyFile) -> m (Maybe KeyFile)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe KeyFile) -> m (Maybe KeyFile))
-> IO (Maybe KeyFile) -> m (Maybe KeyFile)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr SysrootUpgrader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_sysroot_upgrader_dup_origin self'
    maybeResult <- convertIfNonNull result $ \Ptr KeyFile
result' -> do
        result'' <- ((ManagedPtr KeyFile -> KeyFile) -> Ptr KeyFile -> IO KeyFile
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr KeyFile -> KeyFile
GLib.KeyFile.KeyFile) Ptr KeyFile
result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderDupOriginMethodInfo
instance (signature ~ (m (Maybe GLib.KeyFile.KeyFile)), MonadIO m, IsSysrootUpgrader a) => O.OverloadedMethod SysrootUpgraderDupOriginMethodInfo a signature where
    overloadedMethod = sysrootUpgraderDupOrigin

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


#endif

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

foreign import ccall "ostree_sysroot_upgrader_get_origin" ostree_sysroot_upgrader_get_origin :: 
    Ptr SysrootUpgrader ->                  -- self : TInterface (Name {namespace = "OSTree", name = "SysrootUpgrader"})
    IO (Ptr GLib.KeyFile.KeyFile)

-- | /No description available in the introspection data./
sysrootUpgraderGetOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsSysrootUpgrader a) =>
    a
    -- ^ /@self@/: Sysroot
    -> m (Maybe GLib.KeyFile.KeyFile)
    -- ^ __Returns:__ The origin file, or 'P.Nothing' if unknown.
sysrootUpgraderGetOrigin :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSysrootUpgrader a) =>
a -> m (Maybe KeyFile)
sysrootUpgraderGetOrigin a
self = IO (Maybe KeyFile) -> m (Maybe KeyFile)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe KeyFile) -> m (Maybe KeyFile))
-> IO (Maybe KeyFile) -> m (Maybe KeyFile)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr SysrootUpgrader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_sysroot_upgrader_get_origin self'
    maybeResult <- convertIfNonNull result $ \Ptr KeyFile
result' -> do
        result'' <- ((ManagedPtr KeyFile -> KeyFile) -> Ptr KeyFile -> IO KeyFile
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr KeyFile -> KeyFile
GLib.KeyFile.KeyFile) Ptr KeyFile
result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderGetOriginMethodInfo
instance (signature ~ (m (Maybe GLib.KeyFile.KeyFile)), MonadIO m, IsSysrootUpgrader a) => O.OverloadedMethod SysrootUpgraderGetOriginMethodInfo a signature where
    overloadedMethod = sysrootUpgraderGetOrigin

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


#endif

-- method SysrootUpgrader::get_origin_description
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "SysrootUpgrader" }
--           , argCType = Just "OstreeSysrootUpgrader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Upgrader" , 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_sysroot_upgrader_get_origin_description" ostree_sysroot_upgrader_get_origin_description :: 
    Ptr SysrootUpgrader ->                  -- self : TInterface (Name {namespace = "OSTree", name = "SysrootUpgrader"})
    IO CString

-- | /No description available in the introspection data./
sysrootUpgraderGetOriginDescription ::
    (B.CallStack.HasCallStack, MonadIO m, IsSysrootUpgrader a) =>
    a
    -- ^ /@self@/: Upgrader
    -> m (Maybe T.Text)
    -- ^ __Returns:__ A one-line descriptive summary of the origin, or 'P.Nothing' if
    -- unknown.
sysrootUpgraderGetOriginDescription :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSysrootUpgrader a) =>
a -> m (Maybe Text)
sysrootUpgraderGetOriginDescription 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 SysrootUpgrader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_sysroot_upgrader_get_origin_description self'
    maybeResult <- convertIfNonNull result $ \Ptr CChar
result' -> do
        result'' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result'
        freeMem result'
        return result''
    touchManagedPtr self
    return maybeResult

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

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


#endif

-- method SysrootUpgrader::pull
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "SysrootUpgrader" }
--           , argCType = Just "OstreeSysrootUpgrader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Upgrader" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoPullFlags" }
--           , argCType = Just "OstreeRepoPullFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Flags controlling pull behavior"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "upgrader_flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "SysrootUpgraderPullFlags" }
--           , argCType = Just "OstreeSysrootUpgraderPullFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Flags controlling upgrader behavior"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Progress" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_changed"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Whether or not the origin changed"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_pull" ostree_sysroot_upgrader_pull :: 
    Ptr SysrootUpgrader ->                  -- self : TInterface (Name {namespace = "OSTree", name = "SysrootUpgrader"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoPullFlags"})
    CUInt ->                                -- upgrader_flags : TInterface (Name {namespace = "OSTree", name = "SysrootUpgraderPullFlags"})
    Ptr OSTree.AsyncProgress.AsyncProgress -> -- progress : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    Ptr CInt ->                             -- out_changed : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Perform a pull from the origin.  First check if the ref has
-- changed, if so download the linked objects, and store the updated
-- ref locally.  Then /@outChanged@/ will be 'P.True'.
-- 
-- If the origin remote is unchanged, /@outChanged@/ will be set to
-- 'P.False'.
sysrootUpgraderPull ::
    (B.CallStack.HasCallStack, MonadIO m, IsSysrootUpgrader a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: Upgrader
    -> [OSTree.Flags.RepoPullFlags]
    -- ^ /@flags@/: Flags controlling pull behavior
    -> [OSTree.Flags.SysrootUpgraderPullFlags]
    -- ^ /@upgraderFlags@/: Flags controlling upgrader behavior
    -> Maybe (b)
    -- ^ /@progress@/: Progress
    -> Maybe (c)
    -- ^ /@cancellable@/: Cancellable
    -> m (Bool)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderPull :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSysrootUpgrader a, IsAsyncProgress b,
 IsCancellable c) =>
a
-> [RepoPullFlags]
-> [SysrootUpgraderPullFlags]
-> Maybe b
-> Maybe c
-> m Bool
sysrootUpgraderPull a
self [RepoPullFlags]
flags [SysrootUpgraderPullFlags]
upgraderFlags Maybe b
progress Maybe c
cancellable = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr SysrootUpgrader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let flags' = [RepoPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoPullFlags]
flags
    let upgraderFlags' = [SysrootUpgraderPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SysrootUpgraderPullFlags]
upgraderFlags
    maybeProgress <- case progress of
        Maybe b
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr
        Just b
jProgress -> do
            jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
            return jProgress'
    outChanged <- allocMem :: IO (Ptr CInt)
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sysroot_upgrader_pull self' flags' upgraderFlags' maybeProgress outChanged maybeCancellable
        outChanged' <- peek outChanged
        let outChanged'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outChanged'
        touchManagedPtr self
        whenJust progress touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem outChanged
        return outChanged''
     ) (do
        freeMem outChanged
     )

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderPullMethodInfo
instance (signature ~ ([OSTree.Flags.RepoPullFlags] -> [OSTree.Flags.SysrootUpgraderPullFlags] -> Maybe (b) -> Maybe (c) -> m (Bool)), MonadIO m, IsSysrootUpgrader a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SysrootUpgraderPullMethodInfo a signature where
    overloadedMethod = sysrootUpgraderPull

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


#endif

-- method SysrootUpgrader::pull_one_dir
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "SysrootUpgrader" }
--           , argCType = Just "OstreeSysrootUpgrader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Upgrader" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dir_to_pull"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Subdirectory path (should include a leading /)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoPullFlags" }
--           , argCType = Just "OstreeRepoPullFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Flags controlling pull behavior"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "upgrader_flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "SysrootUpgraderPullFlags" }
--           , argCType = Just "OstreeSysrootUpgraderPullFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Flags controlling upgrader behavior"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Progress" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_changed"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Whether or not the origin changed"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_pull_one_dir" ostree_sysroot_upgrader_pull_one_dir :: 
    Ptr SysrootUpgrader ->                  -- self : TInterface (Name {namespace = "OSTree", name = "SysrootUpgrader"})
    CString ->                              -- dir_to_pull : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoPullFlags"})
    CUInt ->                                -- upgrader_flags : TInterface (Name {namespace = "OSTree", name = "SysrootUpgraderPullFlags"})
    Ptr OSTree.AsyncProgress.AsyncProgress -> -- progress : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    Ptr CInt ->                             -- out_changed : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Like 'GI.OSTree.Objects.SysrootUpgrader.sysrootUpgraderPull', but allows retrieving just a
-- subpath of the tree.  This can be used to download metadata files
-- from inside the tree such as package databases.
sysrootUpgraderPullOneDir ::
    (B.CallStack.HasCallStack, MonadIO m, IsSysrootUpgrader a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: Upgrader
    -> T.Text
    -- ^ /@dirToPull@/: Subdirectory path (should include a leading \/)
    -> [OSTree.Flags.RepoPullFlags]
    -- ^ /@flags@/: Flags controlling pull behavior
    -> [OSTree.Flags.SysrootUpgraderPullFlags]
    -- ^ /@upgraderFlags@/: Flags controlling upgrader behavior
    -> Maybe (b)
    -- ^ /@progress@/: Progress
    -> Maybe (c)
    -- ^ /@cancellable@/: Cancellable
    -> m (Bool)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderPullOneDir :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSysrootUpgrader a, IsAsyncProgress b,
 IsCancellable c) =>
a
-> Text
-> [RepoPullFlags]
-> [SysrootUpgraderPullFlags]
-> Maybe b
-> Maybe c
-> m Bool
sysrootUpgraderPullOneDir a
self Text
dirToPull [RepoPullFlags]
flags [SysrootUpgraderPullFlags]
upgraderFlags Maybe b
progress Maybe c
cancellable = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr SysrootUpgrader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    dirToPull' <- textToCString dirToPull
    let flags' = [RepoPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoPullFlags]
flags
    let upgraderFlags' = [SysrootUpgraderPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SysrootUpgraderPullFlags]
upgraderFlags
    maybeProgress <- case progress of
        Maybe b
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr
        Just b
jProgress -> do
            jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
            return jProgress'
    outChanged <- allocMem :: IO (Ptr CInt)
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sysroot_upgrader_pull_one_dir self' dirToPull' flags' upgraderFlags' maybeProgress outChanged maybeCancellable
        outChanged' <- peek outChanged
        let outChanged'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outChanged'
        touchManagedPtr self
        whenJust progress touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem dirToPull'
        freeMem outChanged
        return outChanged''
     ) (do
        freeMem dirToPull'
        freeMem outChanged
     )

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderPullOneDirMethodInfo
instance (signature ~ (T.Text -> [OSTree.Flags.RepoPullFlags] -> [OSTree.Flags.SysrootUpgraderPullFlags] -> Maybe (b) -> Maybe (c) -> m (Bool)), MonadIO m, IsSysrootUpgrader a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SysrootUpgraderPullOneDirMethodInfo a signature where
    overloadedMethod = sysrootUpgraderPullOneDir

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


#endif

-- method SysrootUpgrader::set_origin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "SysrootUpgrader" }
--           , argCType = Just "OstreeSysrootUpgrader*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Sysroot" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "origin"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "KeyFile" }
--           , argCType = Just "GKeyFile*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The new origin" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_set_origin" ostree_sysroot_upgrader_set_origin :: 
    Ptr SysrootUpgrader ->                  -- self : TInterface (Name {namespace = "OSTree", name = "SysrootUpgrader"})
    Ptr GLib.KeyFile.KeyFile ->             -- origin : TInterface (Name {namespace = "GLib", name = "KeyFile"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Replace the origin with /@origin@/.
sysrootUpgraderSetOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsSysrootUpgrader a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: Sysroot
    -> Maybe (GLib.KeyFile.KeyFile)
    -- ^ /@origin@/: The new origin
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderSetOrigin :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSysrootUpgrader a, IsCancellable b) =>
a -> Maybe KeyFile -> Maybe b -> m ()
sysrootUpgraderSetOrigin a
self Maybe KeyFile
origin Maybe b
cancellable = 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 SysrootUpgrader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeOrigin <- case origin of
        Maybe KeyFile
Nothing -> Ptr KeyFile -> IO (Ptr KeyFile)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr KeyFile
forall a. Ptr a
FP.nullPtr
        Just KeyFile
jOrigin -> do
            jOrigin' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
jOrigin
            return jOrigin'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sysroot_upgrader_set_origin self' maybeOrigin maybeCancellable
        touchManagedPtr self
        whenJust origin touchManagedPtr
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SysrootUpgraderSetOriginMethodInfo
instance (signature ~ (Maybe (GLib.KeyFile.KeyFile) -> Maybe (b) -> m ()), MonadIO m, IsSysrootUpgrader a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SysrootUpgraderSetOriginMethodInfo a signature where
    overloadedMethod = sysrootUpgraderSetOrigin

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


#endif

-- method SysrootUpgrader::check_timestamps
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "from_rev"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "From revision" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_rev"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "To revision" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sysroot_upgrader_check_timestamps" ostree_sysroot_upgrader_check_timestamps :: 
    Ptr OSTree.Repo.Repo ->                 -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- from_rev : TBasicType TUTF8
    CString ->                              -- to_rev : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Check that the timestamp on /@toRev@/ is equal to or newer than
-- /@fromRev@/.  This protects systems against man-in-the-middle
-- attackers which provide a client with an older commit.
sysrootUpgraderCheckTimestamps ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.Repo.IsRepo a) =>
    a
    -- ^ /@repo@/: Repo
    -> T.Text
    -- ^ /@fromRev@/: From revision
    -> T.Text
    -- ^ /@toRev@/: To revision
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
sysrootUpgraderCheckTimestamps :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Text -> m ()
sysrootUpgraderCheckTimestamps a
repo Text
fromRev Text
toRev = 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
    repo' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
    fromRev' <- textToCString fromRev
    toRev' <- textToCString toRev
    onException (do
        _ <- propagateGError $ ostree_sysroot_upgrader_check_timestamps repo' fromRev' toRev'
        touchManagedPtr repo
        freeMem fromRev'
        freeMem toRev'
        return ()
     ) (do
        freeMem fromRev'
        freeMem toRev'
     )

#if defined(ENABLE_OVERLOADING)
#endif