{-# 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                            ,
    noDeployment                            ,


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

#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#

    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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.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 (ManagedPtr Deployment)
    deriving (Eq)
foreign import ccall "ostree_deployment_get_type"
    c_ostree_deployment_get_type :: IO GType

instance GObject Deployment where
    gobjectType = c_ostree_deployment_get_type


-- | Convert 'Deployment' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue Deployment where
    toGValue o = do
        gtype <- c_ostree_deployment_get_type
        B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)

    fromGValue gv = do
        ptr <- B.GValue.get_object gv :: IO (Ptr Deployment)
        B.ManagedPtr.newObject Deployment ptr



-- | Type class for types which can be safely cast to `Deployment`, for instance with `toDeployment`.
class (GObject o, O.IsDescendantOf Deployment o) => IsDeployment o
instance (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 :: (MonadIO m, IsDeployment o) => o -> m Deployment
toDeployment = liftIO . unsafeCastTo Deployment

-- | A convenience alias for `Nothing` :: `Maybe` `Deployment`.
noDeployment :: Maybe Deployment
noDeployment = 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 "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.MethodInfo 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

#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 = Nothing , 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 = Nothing , 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 = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bootcsum"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , 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
    -> T.Text
    -> T.Text
    -> Int32
    -> T.Text
    -> Int32
    -> m Deployment
deploymentNew index osname csum deployserial bootcsum bootserial = liftIO $ do
    osname' <- textToCString osname
    csum' <- textToCString csum
    bootcsum' <- textToCString bootcsum
    result <- ostree_deployment_new index osname' csum' deployserial bootcsum' bootserial
    checkUnexpectedReturnNULL "deploymentNew" result
    result' <- (wrapObject Deployment) result
    freeMem osname'
    freeMem csum'
    freeMem bootcsum'
    return 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_clone self'
    checkUnexpectedReturnNULL "deploymentClone" result
    result' <- (wrapObject Deployment) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentCloneMethodInfo
instance (signature ~ (m Deployment), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentCloneMethodInfo a signature where
    overloadedMethod = 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 ap bp = liftIO $ do
    ap' <- unsafeManagedPtrCastPtr ap
    bp' <- unsafeManagedPtrCastPtr bp
    result <- ostree_deployment_equal ap' bp'
    let result' = (/= 0) result
    touchManagedPtr ap
    touchManagedPtr bp
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsDeployment a, IsDeployment b) => O.MethodInfo DeploymentEqualMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_bootconfig self'
    checkUnexpectedReturnNULL "deploymentGetBootconfig" result
    result' <- (newObject OSTree.BootconfigParser.BootconfigParser) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetBootconfigMethodInfo
instance (signature ~ (m OSTree.BootconfigParser.BootconfigParser), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetBootconfigMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_bootcsum self'
    checkUnexpectedReturnNULL "deploymentGetBootcsum" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetBootcsumMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetBootcsumMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_bootserial self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data DeploymentGetBootserialMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetBootserialMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_csum self'
    checkUnexpectedReturnNULL "deploymentGetCsum" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetCsumMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetCsumMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_deployserial self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data DeploymentGetDeployserialMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetDeployserialMethodInfo a signature where
    overloadedMethod = 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 = 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_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
    -> m Int32
deploymentGetIndex self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_index self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data DeploymentGetIndexMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetIndexMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_origin self'
    checkUnexpectedReturnNULL "deploymentGetOrigin" result
    result' <- (newBoxed GLib.KeyFile.KeyFile) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetOriginMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetOriginMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_origin_relpath self'
    checkUnexpectedReturnNULL "deploymentGetOriginRelpath" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetOriginRelpathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetOriginRelpathMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_osname self'
    checkUnexpectedReturnNULL "deploymentGetOsname" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentGetOsnameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetOsnameMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_get_unlocked self'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr self
    return result'

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

#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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_is_pinned self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentIsPinnedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentIsPinnedMethodInfo a signature where
    overloadedMethod = 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 self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_deployment_is_staged self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data DeploymentIsStagedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentIsStagedMethodInfo a signature where
    overloadedMethod = 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 = Nothing , 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 = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 ()

-- | /No description available in the introspection data./
deploymentSetBootconfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a, OSTree.BootconfigParser.IsBootconfigParser b) =>
    a
    -> b
    -> m ()
deploymentSetBootconfig self bootconfig = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    bootconfig' <- unsafeManagedPtrCastPtr bootconfig
    ostree_deployment_set_bootconfig self' bootconfig'
    touchManagedPtr self
    touchManagedPtr bootconfig
    return ()

#if defined(ENABLE_OVERLOADING)
data DeploymentSetBootconfigMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDeployment a, OSTree.BootconfigParser.IsBootconfigParser b) => O.MethodInfo DeploymentSetBootconfigMethodInfo a signature where
    overloadedMethod = 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 = Nothing , 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 = Nothing , 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 ()

-- | /No description available in the introspection data./
deploymentSetBootserial ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> Int32
    -> m ()
deploymentSetBootserial self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    ostree_deployment_set_bootserial self' index
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data DeploymentSetBootserialMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentSetBootserialMethodInfo a signature where
    overloadedMethod = 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 = Nothing , 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 = Nothing , 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 ()

-- | /No description available in the introspection data./
deploymentSetIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> Int32
    -> m ()
deploymentSetIndex self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    ostree_deployment_set_index self' index
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data DeploymentSetIndexMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentSetIndexMethodInfo a signature where
    overloadedMethod = 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 = Nothing , 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 = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 ()

-- | /No description available in the introspection data./
deploymentSetOrigin ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
    a
    -> GLib.KeyFile.KeyFile
    -> m ()
deploymentSetOrigin self origin = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    origin' <- unsafeManagedPtrGetPtr origin
    ostree_deployment_set_origin self' origin'
    touchManagedPtr self
    touchManagedPtr origin
    return ()

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

#endif

-- method Deployment::hash
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "v"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 () ->                               -- v : TBasicType TPtr
    IO Word32

-- | /No description available in the introspection data./
deploymentHash ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    -> m Word32
deploymentHash v = liftIO $ do
    result <- ostree_deployment_hash v
    return result

#if defined(ENABLE_OVERLOADING)
#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 origin = liftIO $ do
    origin' <- unsafeManagedPtrGetPtr origin
    ostree_deployment_origin_remove_transient_state origin'
    touchManagedPtr origin
    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
deploymentUnlockedStateToString state = liftIO $ do
    let state' = (fromIntegral . fromEnum) state
    result <- ostree_deployment_unlocked_state_to_string state'
    checkUnexpectedReturnNULL "deploymentUnlockedStateToString" result
    result' <- cstringToText result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif