module GI.OSTree.Objects.Deployment
(
Deployment(..) ,
IsDeployment ,
toDeployment ,
noDeployment ,
DeploymentCloneMethodInfo ,
deploymentClone ,
DeploymentEqualMethodInfo ,
deploymentEqual ,
DeploymentGetBootconfigMethodInfo ,
deploymentGetBootconfig ,
DeploymentGetBootcsumMethodInfo ,
deploymentGetBootcsum ,
DeploymentGetBootserialMethodInfo ,
deploymentGetBootserial ,
DeploymentGetCsumMethodInfo ,
deploymentGetCsum ,
DeploymentGetDeployserialMethodInfo ,
deploymentGetDeployserial ,
DeploymentGetIndexMethodInfo ,
deploymentGetIndex ,
DeploymentGetOriginMethodInfo ,
deploymentGetOrigin ,
DeploymentGetOriginRelpathMethodInfo ,
deploymentGetOriginRelpath ,
DeploymentGetOsnameMethodInfo ,
deploymentGetOsname ,
DeploymentGetUnlockedMethodInfo ,
deploymentGetUnlocked ,
deploymentHash ,
deploymentNew ,
DeploymentSetBootconfigMethodInfo ,
deploymentSetBootconfig ,
DeploymentSetBootserialMethodInfo ,
deploymentSetBootserial ,
DeploymentSetIndexMethodInfo ,
deploymentSetIndex ,
DeploymentSetOriginMethodInfo ,
deploymentSetOrigin ,
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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.OSTree.Enums as OSTree.Enums
import qualified GI.OSTree.Objects.BootconfigParser as OSTree.BootconfigParser
newtype Deployment = Deployment (ManagedPtr Deployment)
foreign import ccall "ostree_deployment_get_type"
c_ostree_deployment_get_type :: IO GType
instance GObject Deployment where
gobjectType _ = c_ostree_deployment_get_type
class GObject o => IsDeployment o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError Deployment a) =>
IsDeployment a
#endif
instance IsDeployment Deployment
instance GObject.Object.IsObject Deployment
toDeployment :: IsDeployment o => o -> IO Deployment
toDeployment = unsafeCastTo Deployment
noDeployment :: Maybe Deployment
noDeployment = Nothing
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 "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveDeploymentMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
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 "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) => O.IsLabelProxy t (Deployment -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDeploymentMethod t Deployment, O.MethodInfo info Deployment p) => O.IsLabel t (Deployment -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
instance O.HasAttributeList Deployment
type instance O.AttributeList Deployment = DeploymentAttributeList
type DeploymentAttributeList = ('[ ] :: [(Symbol, *)])
type instance O.SignalList Deployment = DeploymentSignalList
type DeploymentSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "ostree_deployment_new" ostree_deployment_new ::
Int32 ->
CString ->
CString ->
Int32 ->
CString ->
Int32 ->
IO (Ptr Deployment)
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'
foreign import ccall "ostree_deployment_clone" ostree_deployment_clone ::
Ptr Deployment ->
IO (Ptr Deployment)
deploymentClone ::
(B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
a
-> m Deployment
deploymentClone self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- ostree_deployment_clone self'
checkUnexpectedReturnNULL "deploymentClone" result
result' <- (wrapObject Deployment) result
touchManagedPtr self
return result'
data DeploymentCloneMethodInfo
instance (signature ~ (m Deployment), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentCloneMethodInfo a signature where
overloadedMethod _ = deploymentClone
foreign import ccall "ostree_deployment_equal" ostree_deployment_equal ::
Ptr Deployment ->
Ptr Deployment ->
IO CInt
deploymentEqual ::
(B.CallStack.HasCallStack, MonadIO m, IsDeployment a, IsDeployment b) =>
a
-> b
-> m Bool
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'
data DeploymentEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsDeployment a, IsDeployment b) => O.MethodInfo DeploymentEqualMethodInfo a signature where
overloadedMethod _ = deploymentEqual
foreign import ccall "ostree_deployment_get_bootconfig" ostree_deployment_get_bootconfig ::
Ptr Deployment ->
IO (Ptr OSTree.BootconfigParser.BootconfigParser)
deploymentGetBootconfig ::
(B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
a
-> m OSTree.BootconfigParser.BootconfigParser
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'
data DeploymentGetBootconfigMethodInfo
instance (signature ~ (m OSTree.BootconfigParser.BootconfigParser), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetBootconfigMethodInfo a signature where
overloadedMethod _ = deploymentGetBootconfig
foreign import ccall "ostree_deployment_get_bootcsum" ostree_deployment_get_bootcsum ::
Ptr Deployment ->
IO CString
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'
data DeploymentGetBootcsumMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetBootcsumMethodInfo a signature where
overloadedMethod _ = deploymentGetBootcsum
foreign import ccall "ostree_deployment_get_bootserial" ostree_deployment_get_bootserial ::
Ptr Deployment ->
IO Int32
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
data DeploymentGetBootserialMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetBootserialMethodInfo a signature where
overloadedMethod _ = deploymentGetBootserial
foreign import ccall "ostree_deployment_get_csum" ostree_deployment_get_csum ::
Ptr Deployment ->
IO CString
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'
data DeploymentGetCsumMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetCsumMethodInfo a signature where
overloadedMethod _ = deploymentGetCsum
foreign import ccall "ostree_deployment_get_deployserial" ostree_deployment_get_deployserial ::
Ptr Deployment ->
IO Int32
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
data DeploymentGetDeployserialMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetDeployserialMethodInfo a signature where
overloadedMethod _ = deploymentGetDeployserial
foreign import ccall "ostree_deployment_get_index" ostree_deployment_get_index ::
Ptr Deployment ->
IO Int32
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
data DeploymentGetIndexMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetIndexMethodInfo a signature where
overloadedMethod _ = deploymentGetIndex
foreign import ccall "ostree_deployment_get_origin" ostree_deployment_get_origin ::
Ptr Deployment ->
IO (Ptr GLib.KeyFile.KeyFile)
deploymentGetOrigin ::
(B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
a
-> m GLib.KeyFile.KeyFile
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'
data DeploymentGetOriginMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetOriginMethodInfo a signature where
overloadedMethod _ = deploymentGetOrigin
foreign import ccall "ostree_deployment_get_origin_relpath" ostree_deployment_get_origin_relpath ::
Ptr Deployment ->
IO CString
deploymentGetOriginRelpath ::
(B.CallStack.HasCallStack, MonadIO m, IsDeployment a) =>
a
-> m T.Text
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'
data DeploymentGetOriginRelpathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetOriginRelpathMethodInfo a signature where
overloadedMethod _ = deploymentGetOriginRelpath
foreign import ccall "ostree_deployment_get_osname" ostree_deployment_get_osname ::
Ptr Deployment ->
IO CString
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'
data DeploymentGetOsnameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetOsnameMethodInfo a signature where
overloadedMethod _ = deploymentGetOsname
foreign import ccall "ostree_deployment_get_unlocked" ostree_deployment_get_unlocked ::
Ptr Deployment ->
IO CUInt
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'
data DeploymentGetUnlockedMethodInfo
instance (signature ~ (m OSTree.Enums.DeploymentUnlockedState), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentGetUnlockedMethodInfo a signature where
overloadedMethod _ = deploymentGetUnlocked
foreign import ccall "ostree_deployment_set_bootconfig" ostree_deployment_set_bootconfig ::
Ptr Deployment ->
Ptr OSTree.BootconfigParser.BootconfigParser ->
IO ()
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 ()
data DeploymentSetBootconfigMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDeployment a, OSTree.BootconfigParser.IsBootconfigParser b) => O.MethodInfo DeploymentSetBootconfigMethodInfo a signature where
overloadedMethod _ = deploymentSetBootconfig
foreign import ccall "ostree_deployment_set_bootserial" ostree_deployment_set_bootserial ::
Ptr Deployment ->
Int32 ->
IO ()
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 ()
data DeploymentSetBootserialMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentSetBootserialMethodInfo a signature where
overloadedMethod _ = deploymentSetBootserial
foreign import ccall "ostree_deployment_set_index" ostree_deployment_set_index ::
Ptr Deployment ->
Int32 ->
IO ()
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 ()
data DeploymentSetIndexMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentSetIndexMethodInfo a signature where
overloadedMethod _ = deploymentSetIndex
foreign import ccall "ostree_deployment_set_origin" ostree_deployment_set_origin ::
Ptr Deployment ->
Ptr GLib.KeyFile.KeyFile ->
IO ()
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 ()
data DeploymentSetOriginMethodInfo
instance (signature ~ (GLib.KeyFile.KeyFile -> m ()), MonadIO m, IsDeployment a) => O.MethodInfo DeploymentSetOriginMethodInfo a signature where
overloadedMethod _ = deploymentSetOrigin
foreign import ccall "ostree_deployment_hash" ostree_deployment_hash ::
Ptr () ->
IO Word32
deploymentHash ::
(B.CallStack.HasCallStack, MonadIO m) =>
Ptr ()
-> m Word32
deploymentHash v = liftIO $ do
result <- ostree_deployment_hash v
return result
foreign import ccall "ostree_deployment_unlocked_state_to_string" ostree_deployment_unlocked_state_to_string ::
CUInt ->
IO CString
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'