{-# 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.Interfaces.Sign
    ( 
#if defined(ENABLE_OVERLOADING)
    SignDummyAddPkMethodInfo                ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignDummyDataMethodInfo                 ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignDummyDataVerifyMethodInfo           ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignDummyGetNameMethodInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignDummyMetadataFormatMethodInfo       ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignDummyMetadataKeyMethodInfo          ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignDummySetPkMethodInfo                ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignDummySetSkMethodInfo                ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519AddPkMethodInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519ClearKeysMethodInfo          ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519DataMethodInfo               ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519DataVerifyMethodInfo         ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519GetNameMethodInfo            ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519LoadPkMethodInfo             ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519MetadataFormatMethodInfo     ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519MetadataKeyMethodInfo        ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519SetPkMethodInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519SetSkMethodInfo              ,
#endif

-- * Exported types
    Sign(..)                                ,
    IsSign                                  ,
    toSign                                  ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [addPk]("GI.OSTree.Interfaces.Sign#g:method:addPk"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [clearKeys]("GI.OSTree.Interfaces.Sign#g:method:clearKeys"), [commit]("GI.OSTree.Interfaces.Sign#g:method:commit"), [commitVerify]("GI.OSTree.Interfaces.Sign#g:method:commitVerify"), [data]("GI.OSTree.Interfaces.Sign#g:method:data"), [dataVerify]("GI.OSTree.Interfaces.Sign#g:method:dataVerify"), [dummyAddPk]("GI.OSTree.Interfaces.Sign#g:method:dummyAddPk"), [dummyData]("GI.OSTree.Interfaces.Sign#g:method:dummyData"), [dummyDataVerify]("GI.OSTree.Interfaces.Sign#g:method:dummyDataVerify"), [dummyGetName]("GI.OSTree.Interfaces.Sign#g:method:dummyGetName"), [dummyMetadataFormat]("GI.OSTree.Interfaces.Sign#g:method:dummyMetadataFormat"), [dummyMetadataKey]("GI.OSTree.Interfaces.Sign#g:method:dummyMetadataKey"), [dummySetPk]("GI.OSTree.Interfaces.Sign#g:method:dummySetPk"), [dummySetSk]("GI.OSTree.Interfaces.Sign#g:method:dummySetSk"), [ed25519AddPk]("GI.OSTree.Interfaces.Sign#g:method:ed25519AddPk"), [ed25519ClearKeys]("GI.OSTree.Interfaces.Sign#g:method:ed25519ClearKeys"), [ed25519Data]("GI.OSTree.Interfaces.Sign#g:method:ed25519Data"), [ed25519DataVerify]("GI.OSTree.Interfaces.Sign#g:method:ed25519DataVerify"), [ed25519GetName]("GI.OSTree.Interfaces.Sign#g:method:ed25519GetName"), [ed25519LoadPk]("GI.OSTree.Interfaces.Sign#g:method:ed25519LoadPk"), [ed25519MetadataFormat]("GI.OSTree.Interfaces.Sign#g:method:ed25519MetadataFormat"), [ed25519MetadataKey]("GI.OSTree.Interfaces.Sign#g:method:ed25519MetadataKey"), [ed25519SetPk]("GI.OSTree.Interfaces.Sign#g:method:ed25519SetPk"), [ed25519SetSk]("GI.OSTree.Interfaces.Sign#g:method:ed25519SetSk"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [loadPk]("GI.OSTree.Interfaces.Sign#g:method:loadPk"), [metadataFormat]("GI.OSTree.Interfaces.Sign#g:method:metadataFormat"), [metadataKey]("GI.OSTree.Interfaces.Sign#g:method:metadataKey"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [summary]("GI.OSTree.Interfaces.Sign#g:method:summary"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getName]("GI.OSTree.Interfaces.Sign#g:method:getName"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setPk]("GI.OSTree.Interfaces.Sign#g:method:setPk"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSk]("GI.OSTree.Interfaces.Sign#g:method:setSk").

#if defined(ENABLE_OVERLOADING)
    ResolveSignMethod                       ,
#endif

-- ** addPk #method:addPk#

#if defined(ENABLE_OVERLOADING)
    SignAddPkMethodInfo                     ,
#endif
    signAddPk                               ,


-- ** clearKeys #method:clearKeys#

#if defined(ENABLE_OVERLOADING)
    SignClearKeysMethodInfo                 ,
#endif
    signClearKeys                           ,


-- ** commit #method:commit#

#if defined(ENABLE_OVERLOADING)
    SignCommitMethodInfo                    ,
#endif
    signCommit                              ,


-- ** commitVerify #method:commitVerify#

#if defined(ENABLE_OVERLOADING)
    SignCommitVerifyMethodInfo              ,
#endif
    signCommitVerify                        ,


-- ** data #method:data#

#if defined(ENABLE_OVERLOADING)
    SignDataMethodInfo                      ,
#endif
    signData                                ,


-- ** dataVerify #method:dataVerify#

#if defined(ENABLE_OVERLOADING)
    SignDataVerifyMethodInfo                ,
#endif
    signDataVerify                          ,


-- ** getAll #method:getAll#

    signGetAll                              ,


-- ** getByName #method:getByName#

    signGetByName                           ,


-- ** getName #method:getName#

#if defined(ENABLE_OVERLOADING)
    SignGetNameMethodInfo                   ,
#endif
    signGetName                             ,


-- ** loadPk #method:loadPk#

#if defined(ENABLE_OVERLOADING)
    SignLoadPkMethodInfo                    ,
#endif
    signLoadPk                              ,


-- ** metadataFormat #method:metadataFormat#

#if defined(ENABLE_OVERLOADING)
    SignMetadataFormatMethodInfo            ,
#endif
    signMetadataFormat                      ,


-- ** metadataKey #method:metadataKey#

#if defined(ENABLE_OVERLOADING)
    SignMetadataKeyMethodInfo               ,
#endif
    signMetadataKey                         ,


-- ** setPk #method:setPk#

#if defined(ENABLE_OVERLOADING)
    SignSetPkMethodInfo                     ,
#endif
    signSetPk                               ,


-- ** setSk #method:setSk#

#if defined(ENABLE_OVERLOADING)
    SignSetSkMethodInfo                     ,
#endif
    signSetSk                               ,


-- ** summary #method:summary#

#if defined(ENABLE_OVERLOADING)
    SignSummaryMethodInfo                   ,
#endif
    signSummary                             ,




    ) 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 GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo

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

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

foreign import ccall "ostree_sign_get_type"
    c_ostree_sign_get_type :: IO B.Types.GType

instance B.Types.TypedObject Sign where
    glibType :: IO GType
glibType = IO GType
c_ostree_sign_get_type

instance B.Types.GObject Sign

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

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

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

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

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

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSignMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSignMethod "addPk" o = SignAddPkMethodInfo
    ResolveSignMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSignMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSignMethod "clearKeys" o = SignClearKeysMethodInfo
    ResolveSignMethod "commit" o = SignCommitMethodInfo
    ResolveSignMethod "commitVerify" o = SignCommitVerifyMethodInfo
    ResolveSignMethod "data" o = SignDataMethodInfo
    ResolveSignMethod "dataVerify" o = SignDataVerifyMethodInfo
    ResolveSignMethod "dummyAddPk" o = SignDummyAddPkMethodInfo
    ResolveSignMethod "dummyData" o = SignDummyDataMethodInfo
    ResolveSignMethod "dummyDataVerify" o = SignDummyDataVerifyMethodInfo
    ResolveSignMethod "dummyGetName" o = SignDummyGetNameMethodInfo
    ResolveSignMethod "dummyMetadataFormat" o = SignDummyMetadataFormatMethodInfo
    ResolveSignMethod "dummyMetadataKey" o = SignDummyMetadataKeyMethodInfo
    ResolveSignMethod "dummySetPk" o = SignDummySetPkMethodInfo
    ResolveSignMethod "dummySetSk" o = SignDummySetSkMethodInfo
    ResolveSignMethod "ed25519AddPk" o = SignEd25519AddPkMethodInfo
    ResolveSignMethod "ed25519ClearKeys" o = SignEd25519ClearKeysMethodInfo
    ResolveSignMethod "ed25519Data" o = SignEd25519DataMethodInfo
    ResolveSignMethod "ed25519DataVerify" o = SignEd25519DataVerifyMethodInfo
    ResolveSignMethod "ed25519GetName" o = SignEd25519GetNameMethodInfo
    ResolveSignMethod "ed25519LoadPk" o = SignEd25519LoadPkMethodInfo
    ResolveSignMethod "ed25519MetadataFormat" o = SignEd25519MetadataFormatMethodInfo
    ResolveSignMethod "ed25519MetadataKey" o = SignEd25519MetadataKeyMethodInfo
    ResolveSignMethod "ed25519SetPk" o = SignEd25519SetPkMethodInfo
    ResolveSignMethod "ed25519SetSk" o = SignEd25519SetSkMethodInfo
    ResolveSignMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSignMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSignMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSignMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSignMethod "loadPk" o = SignLoadPkMethodInfo
    ResolveSignMethod "metadataFormat" o = SignMetadataFormatMethodInfo
    ResolveSignMethod "metadataKey" o = SignMetadataKeyMethodInfo
    ResolveSignMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSignMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSignMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSignMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSignMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSignMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSignMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSignMethod "summary" o = SignSummaryMethodInfo
    ResolveSignMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSignMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSignMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSignMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSignMethod "getName" o = SignGetNameMethodInfo
    ResolveSignMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSignMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSignMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSignMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSignMethod "setPk" o = SignSetPkMethodInfo
    ResolveSignMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSignMethod "setSk" o = SignSetSkMethodInfo
    ResolveSignMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- method Sign::add_pk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "public_key"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "single public key to be added"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_add_pk" ostree_sign_add_pk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- public_key : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Add the public key for verification. Could be called multiple times for
-- adding all needed keys to be used for verification.
-- 
-- The /@publicKey@/ argument depends of the particular engine implementation.
-- 
-- /Since: 2020.2/
signAddPk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@publicKey@/: single public key to be added
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signAddPk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signAddPk a
self GVariant
publicKey = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr GVariant
publicKey' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
publicKey
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign -> Ptr GVariant -> Ptr (Ptr GError) -> IO CInt
ostree_sign_add_pk Ptr Sign
self' Ptr GVariant
publicKey'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
publicKey
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignAddPkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignAddPkMethodInfo a signature where
    overloadedMethod = signAddPk

instance O.OverloadedMethodInfo SignAddPkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signAddPk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signAddPk"
        })


#endif

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

foreign import ccall "ostree_sign_clear_keys" ostree_sign_clear_keys :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Clear all previously preloaded secret and public keys.
-- 
-- /Since: 2020.2/
signClearKeys ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signClearKeys :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m ()
signClearKeys a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign -> Ptr (Ptr GError) -> IO CInt
ostree_sign_clear_keys Ptr Sign
self'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignClearKeysMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignClearKeysMethodInfo a signature where
    overloadedMethod = signClearKeys

instance O.OverloadedMethodInfo SignClearKeysMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signClearKeys",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signClearKeys"
        })


#endif

-- method Sign::commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OsreeRepo object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "SHA256 of given commit to sign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_commit" ostree_sign_commit :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr OSTree.Repo.Repo ->                 -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Add a signature to a commit.
-- 
-- Depending of the signing engine used you will need to load
-- the secret key with @/ostree_sign_set_sk/@.
-- 
-- /Since: 2020.2/
signCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> b
    -- ^ /@repo@/: an @/OsreeRepo/@ object
    -> T.Text
    -- ^ /@commitChecksum@/: SHA256 of given commit to sign
    -> Maybe (c)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signCommit :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSign a, IsRepo b, IsCancellable c) =>
a -> b -> Text -> Maybe c -> m ()
signCommit a
self b
repo Text
commitChecksum Maybe c
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Repo
repo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
repo
    CString
commitChecksum' <- Text -> IO CString
textToCString Text
commitChecksum
    Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
        Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
        Just c
jCancellable -> do
            Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign
-> Ptr Repo
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_sign_commit Ptr Sign
self' Ptr Repo
repo' CString
commitChecksum' Ptr Cancellable
maybeCancellable
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
repo
        forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
     )

#if defined(ENABLE_OVERLOADING)
data SignCommitMethodInfo
instance (signature ~ (b -> T.Text -> Maybe (c) -> m ()), MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SignCommitMethodInfo a signature where
    overloadedMethod = signCommit

instance O.OverloadedMethodInfo SignCommitMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signCommit",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signCommit"
        })


#endif

-- method Sign::commit_verify
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OsreeRepo object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "SHA256 of given commit to verify"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_success_message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "success message returned by the signing engine"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_commit_verify" ostree_sign_commit_verify :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr OSTree.Repo.Repo ->                 -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    Ptr CString ->                          -- out_success_message : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Verify if commit is signed with known key.
-- 
-- Depending of the signing engine used you will need to load
-- the public key(s) for verification with @/ostree_sign_set_pk/@,
-- @/ostree_sign_add_pk/@ and\/or @/ostree_sign_load_pk/@.
-- 
-- /Since: 2020.2/
signCommitVerify ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> b
    -- ^ /@repo@/: an @/OsreeRepo/@ object
    -> T.Text
    -- ^ /@commitChecksum@/: SHA256 of given commit to verify
    -> Maybe (c)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signCommitVerify :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSign a, IsRepo b, IsCancellable c) =>
a -> b -> Text -> Maybe c -> m (Maybe Text)
signCommitVerify a
self b
repo Text
commitChecksum Maybe c
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Repo
repo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
repo
    CString
commitChecksum' <- Text -> IO CString
textToCString Text
commitChecksum
    Ptr CString
outSuccessMessage <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
    Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
        Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
        Just c
jCancellable -> do
            Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign
-> Ptr Repo
-> CString
-> Ptr CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_sign_commit_verify Ptr Sign
self' Ptr Repo
repo' CString
commitChecksum' Ptr CString
outSuccessMessage Ptr Cancellable
maybeCancellable
        CString
outSuccessMessage' <- forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outSuccessMessage
        Maybe Text
maybeOutSuccessMessage' <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
outSuccessMessage' forall a b. (a -> b) -> a -> b
$ \CString
outSuccessMessage'' -> do
            Text
outSuccessMessage''' <- HasCallStack => CString -> IO Text
cstringToText CString
outSuccessMessage''
            forall (m :: * -> *) a. Monad m => a -> m a
return Text
outSuccessMessage'''
        forall a. Ptr a -> IO ()
freeMem CString
outSuccessMessage'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
repo
        forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
        forall a. Ptr a -> IO ()
freeMem Ptr CString
outSuccessMessage
        forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeOutSuccessMessage'
     ) (do
        forall a. Ptr a -> IO ()
freeMem CString
commitChecksum'
        forall a. Ptr a -> IO ()
freeMem Ptr CString
outSuccessMessage
     )

#if defined(ENABLE_OVERLOADING)
data SignCommitVerifyMethodInfo
instance (signature ~ (b -> T.Text -> Maybe (c) -> m ((Maybe T.Text))), MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SignCommitVerifyMethodInfo a signature where
    overloadedMethod = signCommitVerify

instance O.OverloadedMethodInfo SignCommitVerifyMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signCommitVerify",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signCommitVerify"
        })


#endif

-- method Sign::data
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the raw data to be signed with pre-loaded secret key"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signature"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "in case of success will contain signature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_data" ostree_sign_data :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GLib.Bytes.Bytes ->                 -- data : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr (Ptr GLib.Bytes.Bytes) ->           -- signature : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Sign the given /@data@/ with pre-loaded secret key.
-- 
-- Depending of the signing engine used you will need to load
-- the secret key with @/ostree_sign_set_sk/@.
-- 
-- /Since: 2020.2/
signData ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GLib.Bytes.Bytes
    -- ^ /@data@/: the raw data to be signed with pre-loaded secret key
    -> Maybe (b)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m (GLib.Bytes.Bytes)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signData :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSign a, IsCancellable b) =>
a -> Bytes -> Maybe b -> m Bytes
signData a
self Bytes
data_ Maybe b
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Bytes
data_' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
data_
    Ptr (Ptr Bytes)
signature <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign
-> Ptr Bytes
-> Ptr (Ptr Bytes)
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_sign_data Ptr Sign
self' Ptr Bytes
data_' Ptr (Ptr Bytes)
signature Ptr Cancellable
maybeCancellable
        Ptr Bytes
signature' <- forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Bytes)
signature
        Bytes
signature'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
signature'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
data_
        forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
signature
        forall (m :: * -> *) a. Monad m => a -> m a
return Bytes
signature''
     ) (do
        forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Bytes)
signature
     )

#if defined(ENABLE_OVERLOADING)
data SignDataMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Maybe (b) -> m (GLib.Bytes.Bytes)), MonadIO m, IsSign a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SignDataMethodInfo a signature where
    overloadedMethod = signData

instance O.OverloadedMethodInfo SignDataMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signData",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signData"
        })


#endif

-- method Sign::data_verify
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the raw data to check"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signatures"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the signatures to be checked"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_success_message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "success message returned by the signing engine"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_data_verify" ostree_sign_data_verify :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GLib.Bytes.Bytes ->                 -- data : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr GVariant ->                         -- signatures : TVariant
    Ptr CString ->                          -- out_success_message : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Verify given data against signatures with pre-loaded public keys.
-- 
-- Depending of the signing engine used you will need to load
-- the public key(s) with @/ostree_sign_set_pk/@, @/ostree_sign_add_pk/@
-- or @/ostree_sign_load_pk/@.
-- 
-- /Since: 2020.2/
signDataVerify ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GLib.Bytes.Bytes
    -- ^ /@data@/: the raw data to check
    -> GVariant
    -- ^ /@signatures@/: the signatures to be checked
    -> m ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signDataVerify :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> Bytes -> GVariant -> m (Maybe Text)
signDataVerify a
self Bytes
data_ GVariant
signatures = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Bytes
data_' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
data_
    Ptr GVariant
signatures' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
signatures
    Ptr CString
outSuccessMessage <- forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign
-> Ptr Bytes
-> Ptr GVariant
-> Ptr CString
-> Ptr (Ptr GError)
-> IO CInt
ostree_sign_data_verify Ptr Sign
self' Ptr Bytes
data_' Ptr GVariant
signatures' Ptr CString
outSuccessMessage
        CString
outSuccessMessage' <- forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outSuccessMessage
        Maybe Text
maybeOutSuccessMessage' <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
outSuccessMessage' forall a b. (a -> b) -> a -> b
$ \CString
outSuccessMessage'' -> do
            Text
outSuccessMessage''' <- HasCallStack => CString -> IO Text
cstringToText CString
outSuccessMessage''
            forall (m :: * -> *) a. Monad m => a -> m a
return Text
outSuccessMessage'''
        forall a. Ptr a -> IO ()
freeMem CString
outSuccessMessage'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
data_
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
signatures
        forall a. Ptr a -> IO ()
freeMem Ptr CString
outSuccessMessage
        forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeOutSuccessMessage'
     ) (do
        forall a. Ptr a -> IO ()
freeMem Ptr CString
outSuccessMessage
     )

#if defined(ENABLE_OVERLOADING)
data SignDataVerifyMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> GVariant -> m ((Maybe T.Text))), MonadIO m, IsSign a) => O.OverloadedMethod SignDataVerifyMethodInfo a signature where
    overloadedMethod = signDataVerify

instance O.OverloadedMethodInfo SignDataVerifyMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signDataVerify",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signDataVerify"
        })


#endif

-- XXX Could not generate method Sign::dummy_add_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_add_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummyAddPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummyAddPk" Sign) => O.OverloadedMethod SignDummyAddPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummyAddPk" Sign) => O.OverloadedMethodInfo SignDummyAddPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::dummy_data
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_data” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummyDataMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummyData" Sign) => O.OverloadedMethod SignDummyDataMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummyData" Sign) => O.OverloadedMethodInfo SignDummyDataMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::dummy_data_verify
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_data_verify” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummyDataVerifyMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummyDataVerify" Sign) => O.OverloadedMethod SignDummyDataVerifyMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummyDataVerify" Sign) => O.OverloadedMethodInfo SignDummyDataVerifyMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::dummy_get_name
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_get_name” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummyGetNameMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummyGetName" Sign) => O.OverloadedMethod SignDummyGetNameMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummyGetName" Sign) => O.OverloadedMethodInfo SignDummyGetNameMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::dummy_metadata_format
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_metadata_format” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummyMetadataFormatMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummyMetadataFormat" Sign) => O.OverloadedMethod SignDummyMetadataFormatMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummyMetadataFormat" Sign) => O.OverloadedMethodInfo SignDummyMetadataFormatMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::dummy_metadata_key
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_metadata_key” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummyMetadataKeyMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummyMetadataKey" Sign) => O.OverloadedMethod SignDummyMetadataKeyMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummyMetadataKey" Sign) => O.OverloadedMethodInfo SignDummyMetadataKeyMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::dummy_set_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_set_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummySetPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummySetPk" Sign) => O.OverloadedMethod SignDummySetPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummySetPk" Sign) => O.OverloadedMethodInfo SignDummySetPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::dummy_set_sk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_dummy_set_sk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignDummySetSkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "dummySetSk" Sign) => O.OverloadedMethod SignDummySetSkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "dummySetSk" Sign) => O.OverloadedMethodInfo SignDummySetSkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_add_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_add_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519AddPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519AddPk" Sign) => O.OverloadedMethod SignEd25519AddPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519AddPk" Sign) => O.OverloadedMethodInfo SignEd25519AddPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_clear_keys
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_clear_keys” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519ClearKeysMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519ClearKeys" Sign) => O.OverloadedMethod SignEd25519ClearKeysMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519ClearKeys" Sign) => O.OverloadedMethodInfo SignEd25519ClearKeysMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_data
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_data” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519DataMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519Data" Sign) => O.OverloadedMethod SignEd25519DataMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519Data" Sign) => O.OverloadedMethodInfo SignEd25519DataMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_data_verify
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_data_verify” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519DataVerifyMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519DataVerify" Sign) => O.OverloadedMethod SignEd25519DataVerifyMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519DataVerify" Sign) => O.OverloadedMethodInfo SignEd25519DataVerifyMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_get_name
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_get_name” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519GetNameMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519GetName" Sign) => O.OverloadedMethod SignEd25519GetNameMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519GetName" Sign) => O.OverloadedMethodInfo SignEd25519GetNameMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_load_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_load_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519LoadPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519LoadPk" Sign) => O.OverloadedMethod SignEd25519LoadPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519LoadPk" Sign) => O.OverloadedMethodInfo SignEd25519LoadPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_metadata_format
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_metadata_format” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519MetadataFormatMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519MetadataFormat" Sign) => O.OverloadedMethod SignEd25519MetadataFormatMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519MetadataFormat" Sign) => O.OverloadedMethodInfo SignEd25519MetadataFormatMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_metadata_key
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_metadata_key” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519MetadataKeyMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519MetadataKey" Sign) => O.OverloadedMethod SignEd25519MetadataKeyMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519MetadataKey" Sign) => O.OverloadedMethodInfo SignEd25519MetadataKeyMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_set_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_set_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519SetPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519SetPk" Sign) => O.OverloadedMethod SignEd25519SetPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519SetPk" Sign) => O.OverloadedMethodInfo SignEd25519SetPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_set_sk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_set_sk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519SetSkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519SetSk" Sign) => O.OverloadedMethod SignEd25519SetSkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519SetSk" Sign) => O.OverloadedMethodInfo SignEd25519SetSkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- method Sign::get_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , 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_sign_get_name" ostree_sign_get_name :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    IO CString

-- | Return the pointer to the name of currently used\/selected signing engine.
-- 
-- /Since: 2020.2/
signGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m T.Text
    -- ^ __Returns:__ pointer to the name
    -- /@nULL@/ in case of error (unlikely).
signGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m Text
signGetName a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr Sign -> IO CString
ostree_sign_get_name Ptr Sign
self'
    forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"signGetName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data SignGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSign a) => O.OverloadedMethod SignGetNameMethodInfo a signature where
    overloadedMethod = signGetName

instance O.OverloadedMethodInfo SignGetNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signGetName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signGetName"
        })


#endif

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

foreign import ccall "ostree_sign_load_pk" ostree_sign_load_pk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- options : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Load public keys for verification from anywhere.
-- It is expected that all keys would be added to already pre-loaded keys.
-- 
-- The /@options@/ argument depends of the particular engine implementation.
-- 
-- For example, /@ed25515@/ engine could use following string-formatted options:
-- 
-- * /@filename@/ -- single file to use to load keys from
-- * /@basedir@/ -- directory containing subdirectories
-- \'trusted.ed25519.d\' and \'revoked.ed25519.d\' with appropriate
-- public keys. Used for testing and re-definition of system-wide
-- directories if defaults are not suitable for any reason.
-- 
-- 
-- /Since: 2020.2/
signLoadPk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@options@/: any options
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signLoadPk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signLoadPk a
self GVariant
options = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr GVariant
options' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
options
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign -> Ptr GVariant -> Ptr (Ptr GError) -> IO CInt
ostree_sign_load_pk Ptr Sign
self' Ptr GVariant
options'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
options
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignLoadPkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignLoadPkMethodInfo a signature where
    overloadedMethod = signLoadPk

instance O.OverloadedMethodInfo SignLoadPkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signLoadPk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signLoadPk"
        })


#endif

-- method Sign::metadata_format
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , 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_sign_metadata_format" ostree_sign_metadata_format :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    IO CString

-- | Return the pointer to the string with format used in (detached) metadata for
-- current signing engine.
-- 
-- /Since: 2020.2/
signMetadataFormat ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m T.Text
    -- ^ __Returns:__ pointer to the metadata format,
    -- /@nULL@/ in case of error (unlikely).
signMetadataFormat :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m Text
signMetadataFormat a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr Sign -> IO CString
ostree_sign_metadata_format Ptr Sign
self'
    forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"signMetadataFormat" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data SignMetadataFormatMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSign a) => O.OverloadedMethod SignMetadataFormatMethodInfo a signature where
    overloadedMethod = signMetadataFormat

instance O.OverloadedMethodInfo SignMetadataFormatMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signMetadataFormat",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signMetadataFormat"
        })


#endif

-- method Sign::metadata_key
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , 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_sign_metadata_key" ostree_sign_metadata_key :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    IO CString

-- | Return the pointer to the name of the key used in (detached) metadata for
-- current signing engine.
-- 
-- /Since: 2020.2/
signMetadataKey ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m T.Text
    -- ^ __Returns:__ pointer to the metadata key name,
    -- /@nULL@/ in case of error (unlikely).
signMetadataKey :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m Text
signMetadataKey a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr Sign -> IO CString
ostree_sign_metadata_key Ptr Sign
self'
    forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"signMetadataKey" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
    forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data SignMetadataKeyMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSign a) => O.OverloadedMethod SignMetadataKeyMethodInfo a signature where
    overloadedMethod = signMetadataKey

instance O.OverloadedMethodInfo SignMetadataKeyMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signMetadataKey",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signMetadataKey"
        })


#endif

-- method Sign::set_pk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "public_key"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "single public key to be added"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_set_pk" ostree_sign_set_pk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- public_key : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Set the public key for verification. It is expected what all
-- previously pre-loaded public keys will be dropped.
-- 
-- The /@publicKey@/ argument depends of the particular engine implementation.
-- 
-- /Since: 2020.2/
signSetPk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@publicKey@/: single public key to be added
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signSetPk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signSetPk a
self GVariant
publicKey = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr GVariant
publicKey' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
publicKey
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign -> Ptr GVariant -> Ptr (Ptr GError) -> IO CInt
ostree_sign_set_pk Ptr Sign
self' Ptr GVariant
publicKey'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
publicKey
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignSetPkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignSetPkMethodInfo a signature where
    overloadedMethod = signSetPk

instance O.OverloadedMethodInfo SignSetPkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signSetPk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signSetPk"
        })


#endif

-- method Sign::set_sk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "secret_key"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "secret key to be added"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_set_sk" ostree_sign_set_sk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- secret_key : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Set the secret key to be used for signing data, commits and summary.
-- 
-- The /@secretKey@/ argument depends of the particular engine implementation.
-- 
-- /Since: 2020.2/
signSetSk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@secretKey@/: secret key to be added
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signSetSk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signSetSk a
self GVariant
secretKey = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr GVariant
secretKey' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
secretKey
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign -> Ptr GVariant -> Ptr (Ptr GError) -> IO CInt
ostree_sign_set_sk Ptr Sign
self' Ptr GVariant
secretKey'
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
secretKey
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignSetSkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignSetSkMethodInfo a signature where
    overloadedMethod = signSetSk

instance O.OverloadedMethodInfo SignSetSkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signSetSk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signSetSk"
        })


#endif

-- method Sign::summary
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ostree repository" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keys"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "keys -- GVariant containing keys as GVarints specific to signature type."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_summary" ostree_sign_summary :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr OSTree.Repo.Repo ->                 -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr GVariant ->                         -- keys : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Add a signature to a summary file.
-- Based on ostree_repo_add_gpg_signature_summary implementation.
-- 
-- /Since: 2020.2/
signSummary ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: Self
    -> b
    -- ^ /@repo@/: ostree repository
    -> GVariant
    -- ^ /@keys@/: keys -- GVariant containing keys as GVarints specific to signature type.
    -> Maybe (c)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signSummary :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSign a, IsRepo b, IsCancellable c) =>
a -> b -> GVariant -> Maybe c -> m ()
signSummary a
self b
repo GVariant
keys Maybe c
cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr Sign
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Repo
repo' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
repo
    Ptr GVariant
keys' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
keys
    Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
        Maybe c
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
        Just c
jCancellable -> do
            Ptr Cancellable
jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr Sign
-> Ptr Repo
-> Ptr GVariant
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
ostree_sign_summary Ptr Sign
self' Ptr Repo
repo' Ptr GVariant
keys' Ptr Cancellable
maybeCancellable
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
repo
        forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
keys
        forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignSummaryMethodInfo
instance (signature ~ (b -> GVariant -> Maybe (c) -> m ()), MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SignSummaryMethodInfo a signature where
    overloadedMethod = signSummary

instance O.OverloadedMethodInfo SignSummaryMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signSummary",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Interfaces-Sign.html#v:signSummary"
        })


#endif

-- method Sign::get_all
-- method type : MemberFunction
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TPtrArray
--                  (TInterface Name { namespace = "OSTree" , name = "Sign" }))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_sign_get_all" ostree_sign_get_all :: 
    IO (Ptr (GPtrArray (Ptr Sign)))

-- | Return an array with newly allocated instances of all available
-- signing engines; they will not be initialized.
-- 
-- /Since: 2020.2/
signGetAll ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [Sign]
    -- ^ __Returns:__ an array of signing engines
signGetAll :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Sign]
signGetAll  = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    Ptr (GPtrArray (Ptr Sign))
result <- IO (Ptr (GPtrArray (Ptr Sign)))
ostree_sign_get_all
    forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"signGetAll" Ptr (GPtrArray (Ptr Sign))
result
    [Ptr Sign]
result' <- forall a. Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unpackGPtrArray Ptr (GPtrArray (Ptr Sign))
result
    [Sign]
result'' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Sign -> Sign
Sign) [Ptr Sign]
result'
    forall a. Ptr (GPtrArray a) -> IO ()
unrefPtrArray Ptr (GPtrArray (Ptr Sign))
result
    forall (m :: * -> *) a. Monad m => a -> m a
return [Sign]
result''

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "ostree_sign_get_by_name" ostree_sign_get_by_name :: 
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Sign)

-- | Create a new instance of a signing engine.
-- 
-- /Since: 2020.2/
signGetByName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@name@/: the name of desired signature engine
    -> m Sign
    -- ^ __Returns:__ New signing engine, or 'P.Nothing' if the engine is not known /(Can throw 'Data.GI.Base.GError.GError')/
signGetByName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Sign
signGetByName Text
name = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
    CString
name' <- Text -> IO CString
textToCString Text
name
    forall a b. IO a -> IO b -> IO a
onException (do
        Ptr Sign
result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr Sign)
ostree_sign_get_by_name CString
name'
        forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"signGetByName" Ptr Sign
result
        Sign
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Sign -> Sign
Sign) Ptr Sign
result
        forall a. Ptr a -> IO ()
freeMem CString
name'
        forall (m :: * -> *) a. Monad m => a -> m a
return Sign
result'
     ) (do
        forall a. Ptr a -> IO ()
freeMem CString
name'
     )

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif