{-# LANGUAGE TypeApplications #-}


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

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

module GI.OSTree.Objects.BootconfigParser
    ( 

-- * Exported types
    BootconfigParser(..)                    ,
    IsBootconfigParser                      ,
    toBootconfigParser                      ,


 -- * 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.BootconfigParser#g:method:clone"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [get]("GI.OSTree.Objects.BootconfigParser#g:method:get"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [parse]("GI.OSTree.Objects.BootconfigParser#g:method:parse"), [parseAt]("GI.OSTree.Objects.BootconfigParser#g:method:parseAt"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [set]("GI.OSTree.Objects.BootconfigParser#g:method:set"), [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"), [write]("GI.OSTree.Objects.BootconfigParser#g:method:write"), [writeAt]("GI.OSTree.Objects.BootconfigParser#g:method:writeAt").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getOverlayInitrds]("GI.OSTree.Objects.BootconfigParser#g:method:getOverlayInitrds"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getTriesDone]("GI.OSTree.Objects.BootconfigParser#g:method:getTriesDone"), [getTriesLeft]("GI.OSTree.Objects.BootconfigParser#g:method:getTriesLeft").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setOverlayInitrds]("GI.OSTree.Objects.BootconfigParser#g:method:setOverlayInitrds"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveBootconfigParserMethod           ,
#endif

-- ** clone #method:clone#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserCloneMethodInfo         ,
#endif
    bootconfigParserClone                   ,


-- ** get #method:get#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserGetMethodInfo           ,
#endif
    bootconfigParserGet                     ,


-- ** getOverlayInitrds #method:getOverlayInitrds#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserGetOverlayInitrdsMethodInfo,
#endif
    bootconfigParserGetOverlayInitrds       ,


-- ** getTriesDone #method:getTriesDone#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserGetTriesDoneMethodInfo  ,
#endif
    bootconfigParserGetTriesDone            ,


-- ** getTriesLeft #method:getTriesLeft#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserGetTriesLeftMethodInfo  ,
#endif
    bootconfigParserGetTriesLeft            ,


-- ** new #method:new#

    bootconfigParserNew                     ,


-- ** parse #method:parse#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserParseMethodInfo         ,
#endif
    bootconfigParserParse                   ,


-- ** parseAt #method:parseAt#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserParseAtMethodInfo       ,
#endif
    bootconfigParserParseAt                 ,


-- ** set #method:set#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserSetMethodInfo           ,
#endif
    bootconfigParserSet                     ,


-- ** setOverlayInitrds #method:setOverlayInitrds#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserSetOverlayInitrdsMethodInfo,
#endif
    bootconfigParserSetOverlayInitrds       ,


-- ** write #method:write#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserWriteMethodInfo         ,
#endif
    bootconfigParserWrite                   ,


-- ** writeAt #method:writeAt#

#if defined(ENABLE_OVERLOADING)
    BootconfigParserWriteAtMethodInfo       ,
#endif
    bootconfigParserWriteAt                 ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

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

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable

#endif

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

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

foreign import ccall "ostree_bootconfig_parser_get_type"
    c_ostree_bootconfig_parser_get_type :: IO B.Types.GType

instance B.Types.TypedObject BootconfigParser where
    glibType :: IO GType
glibType = IO GType
c_ostree_bootconfig_parser_get_type

instance B.Types.GObject BootconfigParser

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

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

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveBootconfigParserMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveBootconfigParserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveBootconfigParserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveBootconfigParserMethod "clone" o = BootconfigParserCloneMethodInfo
    ResolveBootconfigParserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveBootconfigParserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveBootconfigParserMethod "get" o = BootconfigParserGetMethodInfo
    ResolveBootconfigParserMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveBootconfigParserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveBootconfigParserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveBootconfigParserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveBootconfigParserMethod "parse" o = BootconfigParserParseMethodInfo
    ResolveBootconfigParserMethod "parseAt" o = BootconfigParserParseAtMethodInfo
    ResolveBootconfigParserMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveBootconfigParserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveBootconfigParserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveBootconfigParserMethod "set" o = BootconfigParserSetMethodInfo
    ResolveBootconfigParserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveBootconfigParserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveBootconfigParserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveBootconfigParserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveBootconfigParserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveBootconfigParserMethod "write" o = BootconfigParserWriteMethodInfo
    ResolveBootconfigParserMethod "writeAt" o = BootconfigParserWriteAtMethodInfo
    ResolveBootconfigParserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveBootconfigParserMethod "getOverlayInitrds" o = BootconfigParserGetOverlayInitrdsMethodInfo
    ResolveBootconfigParserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveBootconfigParserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveBootconfigParserMethod "getTriesDone" o = BootconfigParserGetTriesDoneMethodInfo
    ResolveBootconfigParserMethod "getTriesLeft" o = BootconfigParserGetTriesLeftMethodInfo
    ResolveBootconfigParserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveBootconfigParserMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveBootconfigParserMethod "setOverlayInitrds" o = BootconfigParserSetOverlayInitrdsMethodInfo
    ResolveBootconfigParserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveBootconfigParserMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

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

foreign import ccall "ostree_bootconfig_parser_new" ostree_bootconfig_parser_new :: 
    IO (Ptr BootconfigParser)

-- | /No description available in the introspection data./
bootconfigParserNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m BootconfigParser
bootconfigParserNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m BootconfigParser
bootconfigParserNew  = IO BootconfigParser -> m BootconfigParser
forall a. IO a -> m a
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
    result <- IO (Ptr BootconfigParser)
ostree_bootconfig_parser_new
    checkUnexpectedReturnNULL "bootconfigParserNew" result
    result' <- (wrapObject BootconfigParser) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

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

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

-- | /No description available in the introspection data./
bootconfigParserClone ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
    a
    -- ^ /@self@/: Bootconfig to clone
    -> m BootconfigParser
    -- ^ __Returns:__ Copy of /@self@/
bootconfigParserClone :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> m BootconfigParser
bootconfigParserClone a
self = IO BootconfigParser -> m BootconfigParser
forall a. IO a -> m a
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
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_bootconfig_parser_clone self'
    checkUnexpectedReturnNULL "bootconfigParserClone" result
    result' <- (wrapObject BootconfigParser) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data BootconfigParserCloneMethodInfo
instance (signature ~ (m BootconfigParser), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserCloneMethodInfo a signature where
    overloadedMethod = bootconfigParserClone

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


#endif

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

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

-- | Get the value corresponding to /@key@/ from the boot configuration dictionary.
bootconfigParserGet ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
    a
    -- ^ /@self@/: Parser
    -> T.Text
    -- ^ /@key@/: the key name to retrieve
    -> m (Maybe T.Text)
    -- ^ __Returns:__ The corresponding value, or 'P.Nothing' if the key hasn\'t been
    -- found.
bootconfigParserGet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> Text -> m (Maybe Text)
bootconfigParserGet a
self Text
key = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    result <- ostree_bootconfig_parser_get self' key'
    maybeResult <- convertIfNonNull result $ \CString
result' -> do
        result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        return result''
    touchManagedPtr self
    freeMem key'
    return maybeResult

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

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


#endif

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

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

-- | /No description available in the introspection data./
-- 
-- /Since: 2020.7/
bootconfigParserGetOverlayInitrds ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
    a
    -- ^ /@self@/: Parser
    -> m (Maybe [T.Text])
    -- ^ __Returns:__ Array of initrds or 'P.Nothing'
    -- if none are set.
bootconfigParserGetOverlayInitrds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> m (Maybe [Text])
bootconfigParserGetOverlayInitrds a
self = IO (Maybe [Text]) -> m (Maybe [Text])
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_bootconfig_parser_get_overlay_initrds self'
    maybeResult <- convertIfNonNull result $ \Ptr CString
result' -> do
        result'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data BootconfigParserGetOverlayInitrdsMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserGetOverlayInitrdsMethodInfo a signature where
    overloadedMethod = bootconfigParserGetOverlayInitrds

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


#endif

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

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

-- | /No description available in the introspection data./
bootconfigParserGetTriesDone ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
    a
    -- ^ /@self@/: Parser
    -> m Word64
    -- ^ __Returns:__ Amount of boot tries
bootconfigParserGetTriesDone :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> m Word64
bootconfigParserGetTriesDone a
self = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_bootconfig_parser_get_tries_done self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data BootconfigParserGetTriesDoneMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserGetTriesDoneMethodInfo a signature where
    overloadedMethod = bootconfigParserGetTriesDone

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


#endif

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

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

-- | /No description available in the introspection data./
-- 
-- /Since: 2025.2/
bootconfigParserGetTriesLeft ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
    a
    -- ^ /@self@/: Parser
    -> m Word64
    -- ^ __Returns:__ Amount of boot tries left
bootconfigParserGetTriesLeft :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> m Word64
bootconfigParserGetTriesLeft a
self = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_bootconfig_parser_get_tries_left self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data BootconfigParserGetTriesLeftMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserGetTriesLeftMethodInfo a signature where
    overloadedMethod = bootconfigParserGetTriesLeft

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


#endif

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

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

-- | /No description available in the introspection data./
bootconfigParserParse ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
    a
    -> b
    -> Maybe (c)
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
bootconfigParserParse :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsFile b,
 IsCancellable c) =>
a -> b -> Maybe c -> m ()
bootconfigParserParse a
self b
path Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    path' <- unsafeManagedPtrCastPtr path
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_bootconfig_parser_parse self' path' maybeCancellable
        touchManagedPtr self
        touchManagedPtr path
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data BootconfigParserParseMethodInfo
instance (signature ~ (b -> Maybe (c) -> m ()), MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod BootconfigParserParseMethodInfo a signature where
    overloadedMethod = bootconfigParserParse

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


#endif

-- method BootconfigParser::parse_at
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "BootconfigParser" }
--           , argCType = Just "OstreeBootconfigParser*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Parser" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dfd"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Directory fd" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "File path" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_bootconfig_parser_parse_at" ostree_bootconfig_parser_parse_at :: 
    Ptr BootconfigParser ->                 -- self : TInterface (Name {namespace = "OSTree", name = "BootconfigParser"})
    Int32 ->                                -- dfd : TBasicType TInt
    CString ->                              -- path : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Initialize a bootconfig from the given file.
bootconfigParserParseAt ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: Parser
    -> Int32
    -- ^ /@dfd@/: Directory fd
    -> T.Text
    -- ^ /@path@/: File path
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
bootconfigParserParseAt :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsCancellable b) =>
a -> Int32 -> Text -> Maybe b -> m ()
bootconfigParserParseAt a
self Int32
dfd Text
path Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    path' <- textToCString path
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_bootconfig_parser_parse_at self' dfd path' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem path'
        return ()
     ) (do
        freeMem path'
     )

#if defined(ENABLE_OVERLOADING)
data BootconfigParserParseAtMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod BootconfigParserParseAtMethodInfo a signature where
    overloadedMethod = bootconfigParserParseAt

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


#endif

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

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

-- | Set the /@key@/\//@value@/ pair to the boot configuration dictionary.
bootconfigParserSet ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
    a
    -- ^ /@self@/: Parser
    -> T.Text
    -- ^ /@key@/: the key
    -> T.Text
    -- ^ /@value@/: the key
    -> m ()
bootconfigParserSet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> Text -> Text -> m ()
bootconfigParserSet a
self Text
key Text
value = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    key' <- textToCString key
    value' <- textToCString value
    ostree_bootconfig_parser_set self' key' value'
    touchManagedPtr self
    freeMem key'
    freeMem value'
    return ()

#if defined(ENABLE_OVERLOADING)
data BootconfigParserSetMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserSetMethodInfo a signature where
    overloadedMethod = bootconfigParserSet

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


#endif

-- method BootconfigParser::set_overlay_initrds
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "BootconfigParser" }
--           , argCType = Just "OstreeBootconfigParser*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Parser" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "initrds"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "char**"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Array of overlay\n   initrds or %NULL to unset."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_bootconfig_parser_set_overlay_initrds" ostree_bootconfig_parser_set_overlay_initrds :: 
    Ptr BootconfigParser ->                 -- self : TInterface (Name {namespace = "OSTree", name = "BootconfigParser"})
    Ptr CString ->                          -- initrds : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO ()

-- | These are rendered as additional @initrd@ keys in the final bootloader configs. The
-- base initrd is part of the primary keys.
-- 
-- /Since: 2020.7/
bootconfigParserSetOverlayInitrds ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
    a
    -- ^ /@self@/: Parser
    -> Maybe ([T.Text])
    -- ^ /@initrds@/: Array of overlay
    --    initrds or 'P.Nothing' to unset.
    -> m ()
bootconfigParserSetOverlayInitrds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBootconfigParser a) =>
a -> Maybe [Text] -> m ()
bootconfigParserSetOverlayInitrds a
self Maybe [Text]
initrds = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeInitrds <- case initrds of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
FP.nullPtr
        Just [Text]
jInitrds -> do
            jInitrds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jInitrds
            return jInitrds'
    ostree_bootconfig_parser_set_overlay_initrds self' maybeInitrds
    touchManagedPtr self
    mapZeroTerminatedCArray freeMem maybeInitrds
    freeMem maybeInitrds
    return ()

#if defined(ENABLE_OVERLOADING)
data BootconfigParserSetOverlayInitrdsMethodInfo
instance (signature ~ (Maybe ([T.Text]) -> m ()), MonadIO m, IsBootconfigParser a) => O.OverloadedMethod BootconfigParserSetOverlayInitrdsMethodInfo a signature where
    overloadedMethod = bootconfigParserSetOverlayInitrds

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


#endif

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

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

-- | /No description available in the introspection data./
bootconfigParserWrite ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
    a
    -> b
    -> Maybe (c)
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
bootconfigParserWrite :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsFile b,
 IsCancellable c) =>
a -> b -> Maybe c -> m ()
bootconfigParserWrite a
self b
output Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    output' <- unsafeManagedPtrCastPtr output
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_bootconfig_parser_write self' output' maybeCancellable
        touchManagedPtr self
        touchManagedPtr output
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data BootconfigParserWriteMethodInfo
instance (signature ~ (b -> Maybe (c) -> m ()), MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod BootconfigParserWriteMethodInfo a signature where
    overloadedMethod = bootconfigParserWrite

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


#endif

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

foreign import ccall "ostree_bootconfig_parser_write_at" ostree_bootconfig_parser_write_at :: 
    Ptr BootconfigParser ->                 -- self : TInterface (Name {namespace = "OSTree", name = "BootconfigParser"})
    Int32 ->                                -- dfd : TBasicType TInt
    CString ->                              -- path : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | /No description available in the introspection data./
bootconfigParserWriteAt ::
    (B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) =>
    a
    -> Int32
    -> T.Text
    -> Maybe (b)
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
bootconfigParserWriteAt :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBootconfigParser a, IsCancellable b) =>
a -> Int32 -> Text -> Maybe b -> m ()
bootconfigParserWriteAt a
self Int32
dfd Text
path Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr BootconfigParser)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    path' <- textToCString path
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_bootconfig_parser_write_at self' dfd path' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem path'
        return ()
     ) (do
        freeMem path'
     )

#if defined(ENABLE_OVERLOADING)
data BootconfigParserWriteAtMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod BootconfigParserWriteAtMethodInfo a signature where
    overloadedMethod = bootconfigParserWriteAt

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


#endif