{-# LANGUAGE TypeApplications #-}


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

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

module GI.OSTree.Objects.Deployment
    ( 

-- * Exported types
    Deployment(..)                          ,
    IsDeployment                            ,
    toDeployment                            ,


 -- * 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"), [clone]("GI.OSTree.Objects.Deployment#g:method:clone"), [equal]("GI.OSTree.Objects.Deployment#g:method:equal"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hash]("GI.OSTree.Objects.Deployment#g:method:hash"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isPinned]("GI.OSTree.Objects.Deployment#g:method:isPinned"), [isStaged]("GI.OSTree.Objects.Deployment#g:method:isStaged"), [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
-- [getBootconfig]("GI.OSTree.Objects.Deployment#g:method:getBootconfig"), [getBootcsum]("GI.OSTree.Objects.Deployment#g:method:getBootcsum"), [getBootserial]("GI.OSTree.Objects.Deployment#g:method:getBootserial"), [getCsum]("GI.OSTree.Objects.Deployment#g:method:getCsum"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDeployserial]("GI.OSTree.Objects.Deployment#g:method:getDeployserial"), [getIndex]("GI.OSTree.Objects.Deployment#g:method:getIndex"), [getOrigin]("GI.OSTree.Objects.Deployment#g:method:getOrigin"), [getOriginRelpath]("GI.OSTree.Objects.Deployment#g:method:getOriginRelpath"), [getOsname]("GI.OSTree.Objects.Deployment#g:method:getOsname"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getUnlocked]("GI.OSTree.Objects.Deployment#g:method:getUnlocked").
-- 
-- ==== Setters
-- [setBootconfig]("GI.OSTree.Objects.Deployment#g:method:setBootconfig"), [setBootserial]("GI.OSTree.Objects.Deployment#g:method:setBootserial"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setIndex]("GI.OSTree.Objects.Deployment#g:method:setIndex"), [setOrigin]("GI.OSTree.Objects.Deployment#g:method:setOrigin"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveDeploymentMethod                 ,
#endif

-- ** clone #method:clone#

#if defined(ENABLE_OVERLOADING)
    DeploymentCloneMethodInfo               ,
#endif
    deploymentClone                         ,


-- ** equal #method:equal#

#if defined(ENABLE_OVERLOADING)
    DeploymentEqualMethodInfo               ,
#endif
    deploymentEqual                         ,


-- ** getBootconfig #method:getBootconfig#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetBootconfigMethodInfo       ,
#endif
    deploymentGetBootconfig                 ,


-- ** getBootcsum #method:getBootcsum#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetBootcsumMethodInfo         ,
#endif
    deploymentGetBootcsum                   ,


-- ** getBootserial #method:getBootserial#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetBootserialMethodInfo       ,
#endif
    deploymentGetBootserial                 ,


-- ** getCsum #method:getCsum#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetCsumMethodInfo             ,
#endif
    deploymentGetCsum                       ,


-- ** getDeployserial #method:getDeployserial#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetDeployserialMethodInfo     ,
#endif
    deploymentGetDeployserial               ,


-- ** getIndex #method:getIndex#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetIndexMethodInfo            ,
#endif
    deploymentGetIndex                      ,


-- ** getOrigin #method:getOrigin#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetOriginMethodInfo           ,
#endif
    deploymentGetOrigin                     ,


-- ** getOriginRelpath #method:getOriginRelpath#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetOriginRelpathMethodInfo    ,
#endif
    deploymentGetOriginRelpath              ,


-- ** getOsname #method:getOsname#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetOsnameMethodInfo           ,
#endif
    deploymentGetOsname                     ,


-- ** getUnlocked #method:getUnlocked#

#if defined(ENABLE_OVERLOADING)
    DeploymentGetUnlockedMethodInfo         ,
#endif
    deploymentGetUnlocked                   ,


-- ** hash #method:hash#

#if defined(ENABLE_OVERLOADING)
    DeploymentHashMethodInfo                ,
#endif
    deploymentHash                          ,


-- ** isPinned #method:isPinned#

#if defined(ENABLE_OVERLOADING)
    DeploymentIsPinnedMethodInfo            ,
#endif
    deploymentIsPinned                      ,


-- ** isStaged #method:isStaged#

#if defined(ENABLE_OVERLOADING)
    DeploymentIsStagedMethodInfo            ,
#endif
    deploymentIsStaged                      ,


-- ** new #method:new#

    deploymentNew                           ,


-- ** originRemoveTransientState #method:originRemoveTransientState#

    deploymentOriginRemoveTransientState    ,


-- ** setBootconfig #method:setBootconfig#

#if defined(ENABLE_OVERLOADING)
    DeploymentSetBootconfigMethodInfo       ,
#endif
    deploymentSetBootconfig                 ,


-- ** setBootserial #method:setBootserial#

#if defined(ENABLE_OVERLOADING)
    DeploymentSetBootserialMethodInfo       ,
#endif
    deploymentSetBootserial                 ,


-- ** setIndex #method:setIndex#

#if defined(ENABLE_OVERLOADING)
    DeploymentSetIndexMethodInfo            ,
#endif
    deploymentSetIndex                      ,


-- ** setOrigin #method:setOrigin#

#if defined(ENABLE_OVERLOADING)
    DeploymentSetOriginMethodInfo           ,
#endif
    deploymentSetOrigin                     ,


-- ** unlockedStateToString #method:unlockedStateToString#

    deploymentUnlockedStateToString         ,




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

import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Objects.BootconfigParser as OSTree.BootconfigParser

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

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

foreign import ccall "ostree_deployment_get_type"
    c_ostree_deployment_get_type :: IO B.Types.GType

instance B.Types.TypedObject Deployment where
    glibType :: IO GType
glibType = IO GType
c_ostree_deployment_get_type

instance B.Types.GObject Deployment

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

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

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveDeploymentMethod (t :: Symbol) (o :: *) :: * where
    ResolveDeploymentMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDeploymentMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDeploymentMethod "clone" o = DeploymentCloneMethodInfo
    ResolveDeploymentMethod "equal" o = DeploymentEqualMethodInfo
    ResolveDeploymentMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDeploymentMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDeploymentMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDeploymentMethod "hash" o = DeploymentHashMethodInfo
    ResolveDeploymentMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDeploymentMethod "isPinned" o = DeploymentIsPinnedMethodInfo
    ResolveDeploymentMethod "isStaged" o = DeploymentIsStagedMethodInfo
    ResolveDeploymentMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDeploymentMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDeploymentMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDeploymentMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDeploymentMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDeploymentMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDeploymentMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDeploymentMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDeploymentMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDeploymentMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDeploymentMethod "getBootconfig" o = DeploymentGetBootconfigMethodInfo
    ResolveDeploymentMethod "getBootcsum" o = DeploymentGetBootcsumMethodInfo
    ResolveDeploymentMethod "getBootserial" o = DeploymentGetBootserialMethodInfo
    ResolveDeploymentMethod "getCsum" o = DeploymentGetCsumMethodInfo
    ResolveDeploymentMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDeploymentMethod "getDeployserial" o = DeploymentGetDeployserialMethodInfo
    ResolveDeploymentMethod "getIndex" o = DeploymentGetIndexMethodInfo
    ResolveDeploymentMethod "getOrigin" o = DeploymentGetOriginMethodInfo
    ResolveDeploymentMethod "getOriginRelpath" o = DeploymentGetOriginRelpathMethodInfo
    ResolveDeploymentMethod "getOsname" o = DeploymentGetOsnameMethodInfo
    ResolveDeploymentMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDeploymentMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDeploymentMethod "getUnlocked" o = DeploymentGetUnlockedMethodInfo
    ResolveDeploymentMethod "setBootconfig" o = DeploymentSetBootconfigMethodInfo
    ResolveDeploymentMethod "setBootserial" o = DeploymentSetBootserialMethodInfo
    ResolveDeploymentMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDeploymentMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDeploymentMethod "setIndex" o = DeploymentSetIndexMethodInfo
    ResolveDeploymentMethod "setOrigin" o = DeploymentSetOriginMethodInfo
    ResolveDeploymentMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDeploymentMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

-- method Deployment::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "index"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Global index into the bootloader entries"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "osname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "\"stateroot\" for this deployment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "csum"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OSTree commit that will be deployed"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "deployserial"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Unique counter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bootcsum"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Kernel/initrd checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bootserial"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Unique index" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "OSTree" , name = "Deployment" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_new" ostree_deployment_new :: 
    Int32 ->                                -- index : TBasicType TInt
    CString ->                              -- osname : TBasicType TUTF8
    CString ->                              -- csum : TBasicType TUTF8
    Int32 ->                                -- deployserial : TBasicType TInt
    CString ->                              -- bootcsum : TBasicType TUTF8
    Int32 ->                                -- bootserial : TBasicType TInt
    IO (Ptr Deployment)

-- | /No description available in the introspection data./
deploymentNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Int32
    -- ^ /@index@/: Global index into the bootloader entries
    -> T.Text
    -- ^ /@osname@/: \"stateroot\" for this deployment
    -> T.Text
    -- ^ /@csum@/: OSTree commit that will be deployed
    -> Int32
    -- ^ /@deployserial@/: Unique counter
    -> Maybe (T.Text)
    -- ^ /@bootcsum@/: Kernel\/initrd checksum
    -> Int32
    -- ^ /@bootserial@/: Unique index
    -> m Deployment
    -- ^ __Returns:__ New deployment
deploymentNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Int32
-> Text -> Text -> Int32 -> Maybe Text -> Int32 -> m Deployment
deploymentNew Int32
index Text
osname Text
csum Int32
deployserial Maybe Text
bootcsum Int32
bootserial = IO Deployment -> m Deployment
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Deployment -> m Deployment) -> IO Deployment -> m Deployment
forall a b. (a -> b) -> a -> b
$ do
    CString
osname' <- Text -> IO CString
textToCString Text
osname
    CString
csum' <- Text -> IO CString
textToCString Text
csum
    CString
maybeBootcsum <- case Maybe Text
bootcsum of
        Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just Text
jBootcsum -> do
            CString
jBootcsum' <- Text -> IO CString
textToCString Text
jBootcsum
            CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jBootcsum'
    Ptr Deployment
result <- Int32
-> CString
-> CString
-> Int32
-> CString
-> Int32
-> IO (Ptr Deployment)
ostree_deployment_new Int32
index CString
osname' CString
csum' Int32
deployserial CString
maybeBootcsum Int32
bootserial
    Text -> Ptr Deployment -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentNew" Ptr Deployment
result
    Deployment
result' <- ((ManagedPtr Deployment -> Deployment)
-> Ptr Deployment -> IO Deployment
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Deployment -> Deployment
Deployment) Ptr Deployment
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
osname'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
csum'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeBootcsum
    Deployment -> IO Deployment
forall (m :: * -> *) a. Monad m => a -> m a
return Deployment
result'

#if defined(ENABLE_OVERLOADING)
#endif

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

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

-- | /No description available in the introspection data./
deploymentClone ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> m Deployment
    -- ^ __Returns:__ New deep copy of /@self@/
deploymentClone :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Deployment
deploymentClone a
self = IO Deployment -> m Deployment
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Deployment -> m Deployment) -> IO Deployment -> m Deployment
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Deployment
result <- Ptr Deployment -> IO (Ptr Deployment)
ostree_deployment_clone Ptr Deployment
self'
    Text -> Ptr Deployment -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentClone" Ptr Deployment
result
    Deployment
result' <- ((ManagedPtr Deployment -> Deployment)
-> Ptr Deployment -> IO Deployment
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Deployment -> Deployment
Deployment) Ptr Deployment
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Deployment -> IO Deployment
forall (m :: * -> *) a. Monad m => a -> m a
return Deployment
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentCloneMethodInfo
instance (signature ~ (m Deployment), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentCloneMethodInfo a signature where
    overloadedMethod = deploymentClone

instance O.OverloadedMethodInfo DeploymentCloneMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentClone",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentClone"
        }


#endif

-- method Deployment::equal
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "ap"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Deployment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A deployment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bp"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Deployment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A deployment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_equal" ostree_deployment_equal :: 
    Ptr Deployment ->                       -- ap : TInterface (Name {namespace = "OSTree", name = "Deployment"})
    Ptr Deployment ->                       -- bp : TInterface (Name {namespace = "OSTree", name = "Deployment"})
    IO CInt

-- | /No description available in the introspection data./
deploymentEqual ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a, IsDeployment b) =>
    a
    -- ^ /@ap@/: A deployment
    -> b
    -- ^ /@bp@/: A deployment
    -> m Bool
    -- ^ __Returns:__ 'P.True' if deployments have the same osname, csum, and deployserial
deploymentEqual :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDeployment a, IsDeployment b) =>
a -> b -> m Bool
deploymentEqual a
ap b
bp = IO Bool -> m Bool
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
    Ptr Deployment
ap' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
ap
    Ptr Deployment
bp' <- b -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
bp
    CInt
result <- Ptr Deployment -> Ptr Deployment -> IO CInt
ostree_deployment_equal Ptr Deployment
ap' Ptr Deployment
bp'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
ap
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
bp
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsDeployment a, IsDeployment b) => O.OverloadedMethod DeploymentEqualMethodInfo a signature where
    overloadedMethod = deploymentEqual

instance O.OverloadedMethodInfo DeploymentEqualMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentEqual",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentEqual"
        }


#endif

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

foreign import ccall "ostree_deployment_get_bootconfig" ostree_deployment_get_bootconfig :: 
    Ptr Deployment ->                       -- self : TInterface (Name {namespace = "OSTree", name = "Deployment"})
    IO (Ptr OSTree.BootconfigParser.BootconfigParser)

-- | /No description available in the introspection data./
deploymentGetBootconfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> m OSTree.BootconfigParser.BootconfigParser
    -- ^ __Returns:__ Boot configuration
deploymentGetBootconfig :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m BootconfigParser
deploymentGetBootconfig a
self = IO BootconfigParser -> m BootconfigParser
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BootconfigParser -> m BootconfigParser)
-> IO BootconfigParser -> m BootconfigParser
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr BootconfigParser
result <- Ptr Deployment -> IO (Ptr BootconfigParser)
ostree_deployment_get_bootconfig Ptr Deployment
self'
    Text -> Ptr BootconfigParser -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentGetBootconfig" Ptr BootconfigParser
result
    BootconfigParser
result' <- ((ManagedPtr BootconfigParser -> BootconfigParser)
-> Ptr BootconfigParser -> IO BootconfigParser
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr BootconfigParser -> BootconfigParser
OSTree.BootconfigParser.BootconfigParser) Ptr BootconfigParser
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    BootconfigParser -> IO BootconfigParser
forall (m :: * -> *) a. Monad m => a -> m a
return BootconfigParser
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetBootconfigMethodInfo
instance (signature ~ (m OSTree.BootconfigParser.BootconfigParser), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetBootconfigMethodInfo a signature where
    overloadedMethod = deploymentGetBootconfig

instance O.OverloadedMethodInfo DeploymentGetBootconfigMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetBootconfig",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetBootconfig"
        }


#endif

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

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

-- | /No description available in the introspection data./
deploymentGetBootcsum ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> m T.Text
deploymentGetBootcsum :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Text
deploymentGetBootcsum a
self = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr Deployment -> IO CString
ostree_deployment_get_bootcsum Ptr Deployment
self'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentGetBootcsum" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetBootcsumMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetBootcsumMethodInfo a signature where
    overloadedMethod = deploymentGetBootcsum

instance O.OverloadedMethodInfo DeploymentGetBootcsumMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetBootcsum",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetBootcsum"
        }


#endif

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

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

-- | /No description available in the introspection data./
deploymentGetBootserial ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> m Int32
deploymentGetBootserial :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Int32
deploymentGetBootserial a
self = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Int32
result <- Ptr Deployment -> IO Int32
ostree_deployment_get_bootserial Ptr Deployment
self'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DeploymentGetBootserialMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetBootserialMethodInfo a signature where
    overloadedMethod = deploymentGetBootserial

instance O.OverloadedMethodInfo DeploymentGetBootserialMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetBootserial",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetBootserial"
        }


#endif

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

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

-- | /No description available in the introspection data./
deploymentGetCsum ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> m T.Text
deploymentGetCsum :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Text
deploymentGetCsum a
self = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr Deployment -> IO CString
ostree_deployment_get_csum Ptr Deployment
self'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentGetCsum" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetCsumMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetCsumMethodInfo a signature where
    overloadedMethod = deploymentGetCsum

instance O.OverloadedMethodInfo DeploymentGetCsumMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetCsum",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetCsum"
        }


#endif

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

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

-- | /No description available in the introspection data./
deploymentGetDeployserial ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> m Int32
deploymentGetDeployserial :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Int32
deploymentGetDeployserial a
self = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Int32
result <- Ptr Deployment -> IO Int32
ostree_deployment_get_deployserial Ptr Deployment
self'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DeploymentGetDeployserialMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetDeployserialMethodInfo a signature where
    overloadedMethod = deploymentGetDeployserial

instance O.OverloadedMethodInfo DeploymentGetDeployserialMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetDeployserial",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetDeployserial"
        }


#endif

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

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

-- | /No description available in the introspection data./
deploymentGetIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> m Int32
    -- ^ __Returns:__ The global index into the bootloader ordering
deploymentGetIndex :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Int32
deploymentGetIndex a
self = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Int32
result <- Ptr Deployment -> IO Int32
ostree_deployment_get_index Ptr Deployment
self'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DeploymentGetIndexMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetIndexMethodInfo a signature where
    overloadedMethod = deploymentGetIndex

instance O.OverloadedMethodInfo DeploymentGetIndexMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetIndex",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetIndex"
        }


#endif

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

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

-- | /No description available in the introspection data./
deploymentGetOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> m GLib.KeyFile.KeyFile
    -- ^ __Returns:__ Origin
deploymentGetOrigin :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m KeyFile
deploymentGetOrigin a
self = IO KeyFile -> m KeyFile
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO KeyFile -> m KeyFile) -> IO KeyFile -> m KeyFile
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr KeyFile
result <- Ptr Deployment -> IO (Ptr KeyFile)
ostree_deployment_get_origin Ptr Deployment
self'
    Text -> Ptr KeyFile -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentGetOrigin" Ptr KeyFile
result
    KeyFile
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
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    KeyFile -> IO KeyFile
forall (m :: * -> *) a. Monad m => a -> m a
return KeyFile
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetOriginMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetOriginMethodInfo a signature where
    overloadedMethod = deploymentGetOrigin

instance O.OverloadedMethodInfo DeploymentGetOriginMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetOrigin",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetOrigin"
        }


#endif

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

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

-- | Note this function only returns a *relative* path - if you want to
-- access, it, you must either use fd-relative api such as @/openat()/@,
-- or concatenate it with the full 'GI.OSTree.Objects.Sysroot.sysrootGetPath'.
deploymentGetOriginRelpath ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: A deployment
    -> m T.Text
    -- ^ __Returns:__ Path to deployment root directory, relative to sysroot
deploymentGetOriginRelpath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Text
deploymentGetOriginRelpath a
self = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr Deployment -> IO CString
ostree_deployment_get_origin_relpath Ptr Deployment
self'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentGetOriginRelpath" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetOriginRelpathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetOriginRelpathMethodInfo a signature where
    overloadedMethod = deploymentGetOriginRelpath

instance O.OverloadedMethodInfo DeploymentGetOriginRelpathMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetOriginRelpath",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetOriginRelpath"
        }


#endif

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

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

-- | /No description available in the introspection data./
deploymentGetOsname ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> m T.Text
deploymentGetOsname :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Text
deploymentGetOsname a
self = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr Deployment -> IO CString
ostree_deployment_get_osname Ptr Deployment
self'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentGetOsname" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetOsnameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetOsnameMethodInfo a signature where
    overloadedMethod = deploymentGetOsname

instance O.OverloadedMethodInfo DeploymentGetOsnameMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetOsname",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetOsname"
        }


#endif

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

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

-- | /No description available in the introspection data./
-- 
-- /Since: 2016.4/
deploymentGetUnlocked ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> m OSTree.Enums.DeploymentUnlockedState
deploymentGetUnlocked :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m DeploymentUnlockedState
deploymentGetUnlocked a
self = IO DeploymentUnlockedState -> m DeploymentUnlockedState
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DeploymentUnlockedState -> m DeploymentUnlockedState)
-> IO DeploymentUnlockedState -> m DeploymentUnlockedState
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CUInt
result <- Ptr Deployment -> IO CUInt
ostree_deployment_get_unlocked Ptr Deployment
self'
    let result' :: DeploymentUnlockedState
result' = (Int -> DeploymentUnlockedState
forall a. Enum a => Int -> a
toEnum (Int -> DeploymentUnlockedState)
-> (CUInt -> Int) -> CUInt -> DeploymentUnlockedState
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    DeploymentUnlockedState -> IO DeploymentUnlockedState
forall (m :: * -> *) a. Monad m => a -> m a
return DeploymentUnlockedState
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetUnlockedMethodInfo
instance (signature ~ (m OSTree.Enums.DeploymentUnlockedState), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentGetUnlockedMethodInfo a signature where
    overloadedMethod = deploymentGetUnlocked

instance O.OverloadedMethodInfo DeploymentGetUnlockedMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentGetUnlocked",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentGetUnlocked"
        }


#endif

-- method Deployment::hash
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "v"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Deployment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Deployment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_hash" ostree_deployment_hash :: 
    Ptr Deployment ->                       -- v : TInterface (Name {namespace = "OSTree", name = "Deployment"})
    IO Word32

-- | /No description available in the introspection data./
deploymentHash ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@v@/: Deployment
    -> m Word32
    -- ^ __Returns:__ An integer suitable for use in a @GHashTable@
deploymentHash :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Word32
deploymentHash a
v = IO Word32 -> m Word32
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
    Ptr Deployment
v' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
v
    Word32
result <- Ptr Deployment -> IO Word32
ostree_deployment_hash Ptr Deployment
v'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
v
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data DeploymentHashMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentHashMethodInfo a signature where
    overloadedMethod = deploymentHash

instance O.OverloadedMethodInfo DeploymentHashMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentHash",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentHash"
        }


#endif

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

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

-- | See 'GI.OSTree.Objects.Sysroot.sysrootDeploymentSetPinned'.
-- 
-- /Since: 2018.3/
deploymentIsPinned ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> m Bool
    -- ^ __Returns:__ @TRUE@ if deployment will not be subject to GC
deploymentIsPinned :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Bool
deploymentIsPinned a
self = IO Bool -> m Bool
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
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CInt
result <- Ptr Deployment -> IO CInt
ostree_deployment_is_pinned Ptr Deployment
self'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentIsPinnedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentIsPinnedMethodInfo a signature where
    overloadedMethod = deploymentIsPinned

instance O.OverloadedMethodInfo DeploymentIsPinnedMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentIsPinned",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentIsPinned"
        }


#endif

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

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

-- | /No description available in the introspection data./
-- 
-- /Since: 2018.3/
deploymentIsStaged ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> m Bool
    -- ^ __Returns:__ @TRUE@ if deployment should be \"finalized\" at shutdown time
deploymentIsStaged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> m Bool
deploymentIsStaged a
self = IO Bool -> m Bool
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
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CInt
result <- Ptr Deployment -> IO CInt
ostree_deployment_is_staged Ptr Deployment
self'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DeploymentIsStagedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentIsStagedMethodInfo a signature where
    overloadedMethod = deploymentIsStaged

instance O.OverloadedMethodInfo DeploymentIsStagedMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentIsStaged",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentIsStaged"
        }


#endif

-- method Deployment::set_bootconfig
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Deployment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Deployment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bootconfig"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "BootconfigParser" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Bootloader configuration object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_set_bootconfig" ostree_deployment_set_bootconfig :: 
    Ptr Deployment ->                       -- self : TInterface (Name {namespace = "OSTree", name = "Deployment"})
    Ptr OSTree.BootconfigParser.BootconfigParser -> -- bootconfig : TInterface (Name {namespace = "OSTree", name = "BootconfigParser"})
    IO ()

-- | Set or clear the bootloader configuration.
deploymentSetBootconfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a, OSTree.BootconfigParser.IsBootconfigParser b) =>
    a
    -- ^ /@self@/: Deployment
    -> Maybe (b)
    -- ^ /@bootconfig@/: Bootloader configuration object
    -> m ()
deploymentSetBootconfig :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDeployment a, IsBootconfigParser b) =>
a -> Maybe b -> m ()
deploymentSetBootconfig a
self Maybe b
bootconfig = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr BootconfigParser
maybeBootconfig <- case Maybe b
bootconfig of
        Maybe b
Nothing -> Ptr BootconfigParser -> IO (Ptr BootconfigParser)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr BootconfigParser
forall a. Ptr a
nullPtr
        Just b
jBootconfig -> do
            Ptr BootconfigParser
jBootconfig' <- b -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jBootconfig
            Ptr BootconfigParser -> IO (Ptr BootconfigParser)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr BootconfigParser
jBootconfig'
    Ptr Deployment -> Ptr BootconfigParser -> IO ()
ostree_deployment_set_bootconfig Ptr Deployment
self' Ptr BootconfigParser
maybeBootconfig
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
bootconfig b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DeploymentSetBootconfigMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsDeployment a, OSTree.BootconfigParser.IsBootconfigParser b) => O.OverloadedMethod DeploymentSetBootconfigMethodInfo a signature where
    overloadedMethod = deploymentSetBootconfig

instance O.OverloadedMethodInfo DeploymentSetBootconfigMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentSetBootconfig",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentSetBootconfig"
        }


#endif

-- method Deployment::set_bootserial
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Deployment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Deployment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Don't use this" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_set_bootserial" ostree_deployment_set_bootserial :: 
    Ptr Deployment ->                       -- self : TInterface (Name {namespace = "OSTree", name = "Deployment"})
    Int32 ->                                -- index : TBasicType TInt
    IO ()

-- | Should never have been made public API; don\'t use this.
deploymentSetBootserial ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> Int32
    -- ^ /@index@/: Don\'t use this
    -> m ()
deploymentSetBootserial :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> Int32 -> m ()
deploymentSetBootserial a
self Int32
index = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Deployment -> Int32 -> IO ()
ostree_deployment_set_bootserial Ptr Deployment
self' Int32
index
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DeploymentSetBootserialMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentSetBootserialMethodInfo a signature where
    overloadedMethod = deploymentSetBootserial

instance O.OverloadedMethodInfo DeploymentSetBootserialMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentSetBootserial",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentSetBootserial"
        }


#endif

-- method Deployment::set_index
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Deployment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Deployment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Index into bootloader ordering"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_set_index" ostree_deployment_set_index :: 
    Ptr Deployment ->                       -- self : TInterface (Name {namespace = "OSTree", name = "Deployment"})
    Int32 ->                                -- index : TBasicType TInt
    IO ()

-- | Sets the global index into the bootloader ordering.
deploymentSetIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> Int32
    -- ^ /@index@/: Index into bootloader ordering
    -> m ()
deploymentSetIndex :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> Int32 -> m ()
deploymentSetIndex a
self Int32
index = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Deployment -> Int32 -> IO ()
ostree_deployment_set_index Ptr Deployment
self' Int32
index
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DeploymentSetIndexMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentSetIndexMethodInfo a signature where
    overloadedMethod = deploymentSetIndex

instance O.OverloadedMethodInfo DeploymentSetIndexMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentSetIndex",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentSetIndex"
        }


#endif

-- method Deployment::set_origin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Deployment" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Deployment" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "origin"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "KeyFile" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Set the origin for this deployment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

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

-- | Replace the \"origin\", which is a description of the source
-- of the deployment and how to update to the next version.
deploymentSetOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -- ^ /@self@/: Deployment
    -> Maybe (GLib.KeyFile.KeyFile)
    -- ^ /@origin@/: Set the origin for this deployment
    -> m ()
deploymentSetOrigin :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeployment a) =>
a -> Maybe KeyFile -> m ()
deploymentSetOrigin a
self Maybe KeyFile
origin = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Deployment
self' <- a -> IO (Ptr Deployment)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr KeyFile
maybeOrigin <- case Maybe KeyFile
origin of
        Maybe KeyFile
Nothing -> Ptr KeyFile -> IO (Ptr KeyFile)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr KeyFile
forall a. Ptr a
nullPtr
        Just KeyFile
jOrigin -> do
            Ptr KeyFile
jOrigin' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
jOrigin
            Ptr KeyFile -> IO (Ptr KeyFile)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr KeyFile
jOrigin'
    Ptr Deployment -> Ptr KeyFile -> IO ()
ostree_deployment_set_origin Ptr Deployment
self' Ptr KeyFile
maybeOrigin
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Maybe KeyFile -> (KeyFile -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe KeyFile
origin KeyFile -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DeploymentSetOriginMethodInfo
instance (signature ~ (Maybe (GLib.KeyFile.KeyFile) -> m ()), MonadIO m, IsDeployment a) => O.OverloadedMethod DeploymentSetOriginMethodInfo a signature where
    overloadedMethod = deploymentSetOrigin

instance O.OverloadedMethodInfo DeploymentSetOriginMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.OSTree.Objects.Deployment.deploymentSetOrigin",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ostree-1.0.14/docs/GI-OSTree-Objects-Deployment.html#v:deploymentSetOrigin"
        }


#endif

-- method Deployment::origin_remove_transient_state
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "origin"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "KeyFile" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An origin" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_origin_remove_transient_state" ostree_deployment_origin_remove_transient_state :: 
    Ptr GLib.KeyFile.KeyFile ->             -- origin : TInterface (Name {namespace = "GLib", name = "KeyFile"})
    IO ()

-- | The intention of an origin file is primarily describe the \"inputs\" that
-- resulted in a deployment, and it\'s commonly used to derive the new state. For
-- example, a key value (in pure libostree mode) is the \"refspec\". However,
-- libostree (or other applications) may want to store \"transient\" state that
-- should not be carried across upgrades.
-- 
-- This function just removes all members of the @libostree-transient@ group.
-- The name of that group is available to all libostree users; best practice
-- would be to prefix values underneath there with a short identifier for your
-- software.
-- 
-- Additionally, this function will remove the @origin\/unlocked@ and
-- @origin\/override-commit@ members; these should be considered transient state
-- that should have been under an explicit group.
-- 
-- /Since: 2018.3/
deploymentOriginRemoveTransientState ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.KeyFile.KeyFile
    -- ^ /@origin@/: An origin
    -> m ()
deploymentOriginRemoveTransientState :: forall (m :: * -> *). (HasCallStack, MonadIO m) => KeyFile -> m ()
deploymentOriginRemoveTransientState KeyFile
origin = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr KeyFile
origin' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
origin
    Ptr KeyFile -> IO ()
ostree_deployment_origin_remove_transient_state Ptr KeyFile
origin'
    KeyFile -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr KeyFile
origin
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif

-- method Deployment::unlocked_state_to_string
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "state"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "DeploymentUnlockedState" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_deployment_unlocked_state_to_string" ostree_deployment_unlocked_state_to_string :: 
    CUInt ->                                -- state : TInterface (Name {namespace = "OSTree", name = "DeploymentUnlockedState"})
    IO CString

-- | /No description available in the introspection data./
-- 
-- /Since: 2016.4/
deploymentUnlockedStateToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    OSTree.Enums.DeploymentUnlockedState
    -> m T.Text
    -- ^ __Returns:__ Description of state
deploymentUnlockedStateToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DeploymentUnlockedState -> m Text
deploymentUnlockedStateToString DeploymentUnlockedState
state = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    let state' :: CUInt
state' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (DeploymentUnlockedState -> Int)
-> DeploymentUnlockedState
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DeploymentUnlockedState -> Int
forall a. Enum a => a -> Int
fromEnum) DeploymentUnlockedState
state
    CString
result <- CUInt -> IO CString
ostree_deployment_unlocked_state_to_string CUInt
state'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deploymentUnlockedStateToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
#endif