{-# LANGUAGE TypeApplications #-}


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

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

module GI.OSTree.Objects.GpgVerifyResult
    ( 

-- * Exported types
    GpgVerifyResult(..)                     ,
    IsGpgVerifyResult                       ,
    toGpgVerifyResult                       ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [countAll]("GI.OSTree.Objects.GpgVerifyResult#g:method:countAll"), [countValid]("GI.OSTree.Objects.GpgVerifyResult#g:method:countValid"), [describe]("GI.OSTree.Objects.GpgVerifyResult#g:method:describe"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [get]("GI.OSTree.Objects.GpgVerifyResult#g:method:get"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [init]("GI.Gio.Interfaces.Initable#g:method:init"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [lookup]("GI.OSTree.Objects.GpgVerifyResult#g:method:lookup"), [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"), [requireValidSignature]("GI.OSTree.Objects.GpgVerifyResult#g:method:requireValidSignature"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getAll]("GI.OSTree.Objects.GpgVerifyResult#g:method:getAll"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [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"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveGpgVerifyResultMethod            ,
#endif

-- ** countAll #method:countAll#

#if defined(ENABLE_OVERLOADING)
    GpgVerifyResultCountAllMethodInfo       ,
#endif
    gpgVerifyResultCountAll                 ,


-- ** countValid #method:countValid#

#if defined(ENABLE_OVERLOADING)
    GpgVerifyResultCountValidMethodInfo     ,
#endif
    gpgVerifyResultCountValid               ,


-- ** describe #method:describe#

#if defined(ENABLE_OVERLOADING)
    GpgVerifyResultDescribeMethodInfo       ,
#endif
    gpgVerifyResultDescribe                 ,


-- ** describeVariant #method:describeVariant#

    gpgVerifyResultDescribeVariant          ,


-- ** get #method:get#

#if defined(ENABLE_OVERLOADING)
    GpgVerifyResultGetMethodInfo            ,
#endif
    gpgVerifyResultGet                      ,


-- ** getAll #method:getAll#

#if defined(ENABLE_OVERLOADING)
    GpgVerifyResultGetAllMethodInfo         ,
#endif
    gpgVerifyResultGetAll                   ,


-- ** lookup #method:lookup#

#if defined(ENABLE_OVERLOADING)
    GpgVerifyResultLookupMethodInfo         ,
#endif
    gpgVerifyResultLookup                   ,


-- ** requireValidSignature #method:requireValidSignature#

#if defined(ENABLE_OVERLOADING)
    GpgVerifyResultRequireValidSignatureMethodInfo,
#endif
    gpgVerifyResultRequireValidSignature    ,




    ) 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.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.String as GLib.String
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags

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

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

foreign import ccall "ostree_gpg_verify_result_get_type"
    c_ostree_gpg_verify_result_get_type :: IO B.Types.GType

instance B.Types.TypedObject GpgVerifyResult where
    glibType :: IO GType
glibType = IO GType
c_ostree_gpg_verify_result_get_type

instance B.Types.GObject GpgVerifyResult

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

instance O.HasParentTypes GpgVerifyResult
type instance O.ParentTypes GpgVerifyResult = '[GObject.Object.Object, Gio.Initable.Initable]

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

-- | Convert 'GpgVerifyResult' 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 GpgVerifyResult) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_gpg_verify_result_get_type
    gvalueSet_ :: Ptr GValue -> Maybe GpgVerifyResult -> IO ()
gvalueSet_ Ptr GValue
gv Maybe GpgVerifyResult
P.Nothing = Ptr GValue -> Ptr GpgVerifyResult -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr GpgVerifyResult
forall a. Ptr a
FP.nullPtr :: FP.Ptr GpgVerifyResult)
    gvalueSet_ Ptr GValue
gv (P.Just GpgVerifyResult
obj) = GpgVerifyResult -> (Ptr GpgVerifyResult -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr GpgVerifyResult
obj (Ptr GValue -> Ptr GpgVerifyResult -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe GpgVerifyResult)
gvalueGet_ Ptr GValue
gv = do
        Ptr GpgVerifyResult
ptr <- Ptr GValue -> IO (Ptr GpgVerifyResult)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr GpgVerifyResult)
        if Ptr GpgVerifyResult
ptr Ptr GpgVerifyResult -> Ptr GpgVerifyResult -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr GpgVerifyResult
forall a. Ptr a
FP.nullPtr
        then GpgVerifyResult -> Maybe GpgVerifyResult
forall a. a -> Maybe a
P.Just (GpgVerifyResult -> Maybe GpgVerifyResult)
-> IO GpgVerifyResult -> IO (Maybe GpgVerifyResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr GpgVerifyResult -> GpgVerifyResult)
-> Ptr GpgVerifyResult -> IO GpgVerifyResult
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr GpgVerifyResult -> GpgVerifyResult
GpgVerifyResult Ptr GpgVerifyResult
ptr
        else Maybe GpgVerifyResult -> IO (Maybe GpgVerifyResult)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GpgVerifyResult
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveGpgVerifyResultMethod (t :: Symbol) (o :: *) :: * where
    ResolveGpgVerifyResultMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveGpgVerifyResultMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveGpgVerifyResultMethod "countAll" o = GpgVerifyResultCountAllMethodInfo
    ResolveGpgVerifyResultMethod "countValid" o = GpgVerifyResultCountValidMethodInfo
    ResolveGpgVerifyResultMethod "describe" o = GpgVerifyResultDescribeMethodInfo
    ResolveGpgVerifyResultMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveGpgVerifyResultMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveGpgVerifyResultMethod "get" o = GpgVerifyResultGetMethodInfo
    ResolveGpgVerifyResultMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveGpgVerifyResultMethod "init" o = Gio.Initable.InitableInitMethodInfo
    ResolveGpgVerifyResultMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveGpgVerifyResultMethod "lookup" o = GpgVerifyResultLookupMethodInfo
    ResolveGpgVerifyResultMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveGpgVerifyResultMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveGpgVerifyResultMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveGpgVerifyResultMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveGpgVerifyResultMethod "requireValidSignature" o = GpgVerifyResultRequireValidSignatureMethodInfo
    ResolveGpgVerifyResultMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveGpgVerifyResultMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveGpgVerifyResultMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveGpgVerifyResultMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveGpgVerifyResultMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveGpgVerifyResultMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveGpgVerifyResultMethod "getAll" o = GpgVerifyResultGetAllMethodInfo
    ResolveGpgVerifyResultMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveGpgVerifyResultMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveGpgVerifyResultMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveGpgVerifyResultMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveGpgVerifyResultMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveGpgVerifyResultMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveGpgVerifyResultMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

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

foreign import ccall "ostree_gpg_verify_result_count_all" ostree_gpg_verify_result_count_all :: 
    Ptr GpgVerifyResult ->                  -- result : TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"})
    IO Word32

-- | Counts all the signatures in /@result@/.
gpgVerifyResultCountAll ::
    (B.CallStack.HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
    a
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> m Word32
    -- ^ __Returns:__ signature count
gpgVerifyResultCountAll :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
a -> m Word32
gpgVerifyResultCountAll a
result_ = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr GpgVerifyResult
result_' <- a -> IO (Ptr GpgVerifyResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    Word32
result <- Ptr GpgVerifyResult -> IO Word32
ostree_gpg_verify_result_count_all Ptr GpgVerifyResult
result_'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data GpgVerifyResultCountAllMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsGpgVerifyResult a) => O.OverloadedMethod GpgVerifyResultCountAllMethodInfo a signature where
    overloadedMethod = gpgVerifyResultCountAll

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


#endif

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

foreign import ccall "ostree_gpg_verify_result_count_valid" ostree_gpg_verify_result_count_valid :: 
    Ptr GpgVerifyResult ->                  -- result : TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"})
    IO Word32

-- | Counts only the valid signatures in /@result@/.
gpgVerifyResultCountValid ::
    (B.CallStack.HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
    a
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> m Word32
    -- ^ __Returns:__ valid signature count
gpgVerifyResultCountValid :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
a -> m Word32
gpgVerifyResultCountValid a
result_ = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr GpgVerifyResult
result_' <- a -> IO (Ptr GpgVerifyResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    Word32
result <- Ptr GpgVerifyResult -> IO Word32
ostree_gpg_verify_result_count_valid Ptr GpgVerifyResult
result_'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data GpgVerifyResultCountValidMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsGpgVerifyResult a) => O.OverloadedMethod GpgVerifyResultCountValidMethodInfo a signature where
    overloadedMethod = gpgVerifyResultCountValid

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


#endif

-- method GpgVerifyResult::describe
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "GpgVerifyResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeGpgVerifyResult"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "which signature to describe"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "output_buffer"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "String" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GString to hold the description"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line_prefix"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "optional line prefix string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "GpgSignatureFormatFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "flags to adjust the description format"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_gpg_verify_result_describe" ostree_gpg_verify_result_describe :: 
    Ptr GpgVerifyResult ->                  -- result : TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"})
    Word32 ->                               -- signature_index : TBasicType TUInt
    Ptr GLib.String.String ->               -- output_buffer : TInterface (Name {namespace = "GLib", name = "String"})
    CString ->                              -- line_prefix : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "GpgSignatureFormatFlags"})
    IO ()

-- | Appends a brief, human-readable description of the GPG signature at
-- /@signatureIndex@/ in /@result@/ to the /@outputBuffer@/.  The description
-- spans multiple lines.  A /@linePrefix@/ string, if given, will precede
-- each line of the description.
-- 
-- The /@flags@/ argument is reserved for future variations to the description
-- format.  Currently must be 0.
-- 
-- It is a programmer error to request an invalid /@signatureIndex@/.  Use
-- 'GI.OSTree.Objects.GpgVerifyResult.gpgVerifyResultCountAll' to find the number of signatures in
-- /@result@/.
gpgVerifyResultDescribe ::
    (B.CallStack.HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
    a
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> Word32
    -- ^ /@signatureIndex@/: which signature to describe
    -> GLib.String.String
    -- ^ /@outputBuffer@/: a t'GI.GLib.Structs.String.String' to hold the description
    -> Maybe (T.Text)
    -- ^ /@linePrefix@/: optional line prefix string
    -> [OSTree.Flags.GpgSignatureFormatFlags]
    -- ^ /@flags@/: flags to adjust the description format
    -> m ()
gpgVerifyResultDescribe :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
a
-> Word32
-> String
-> Maybe Text
-> [GpgSignatureFormatFlags]
-> m ()
gpgVerifyResultDescribe a
result_ Word32
signatureIndex String
outputBuffer Maybe Text
linePrefix [GpgSignatureFormatFlags]
flags = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr GpgVerifyResult
result_' <- a -> IO (Ptr GpgVerifyResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    Ptr String
outputBuffer' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
outputBuffer
    Ptr CChar
maybeLinePrefix <- case Maybe Text
linePrefix of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jLinePrefix -> do
            Ptr CChar
jLinePrefix' <- Text -> IO (Ptr CChar)
textToCString Text
jLinePrefix
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jLinePrefix'
    let flags' :: CUInt
flags' = [GpgSignatureFormatFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [GpgSignatureFormatFlags]
flags
    Ptr GpgVerifyResult
-> Word32 -> Ptr String -> Ptr CChar -> CUInt -> IO ()
ostree_gpg_verify_result_describe Ptr GpgVerifyResult
result_' Word32
signatureIndex Ptr String
outputBuffer' Ptr CChar
maybeLinePrefix CUInt
flags'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
    String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
outputBuffer
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeLinePrefix
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data GpgVerifyResultDescribeMethodInfo
instance (signature ~ (Word32 -> GLib.String.String -> Maybe (T.Text) -> [OSTree.Flags.GpgSignatureFormatFlags] -> m ()), MonadIO m, IsGpgVerifyResult a) => O.OverloadedMethod GpgVerifyResultDescribeMethodInfo a signature where
    overloadedMethod = gpgVerifyResultDescribe

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


#endif

-- method GpgVerifyResult::get
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "GpgVerifyResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeGpgVerifyResult"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "which signature to get attributes from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "attrs"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface
--                    Name { namespace = "OSTree" , name = "GpgSignatureAttr" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of requested attributes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_attrs"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Length of the @attrs array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "n_attrs"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "Length of the @attrs array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just TVariant
-- throws : False
-- Skip return : False

foreign import ccall "ostree_gpg_verify_result_get" ostree_gpg_verify_result_get :: 
    Ptr GpgVerifyResult ->                  -- result : TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"})
    Word32 ->                               -- signature_index : TBasicType TUInt
    Ptr CUInt ->                            -- attrs : TCArray False (-1) 3 (TInterface (Name {namespace = "OSTree", name = "GpgSignatureAttr"}))
    Word32 ->                               -- n_attrs : TBasicType TUInt
    IO (Ptr GVariant)

-- | Builds a t'GVariant' tuple of requested attributes for the GPG signature at
-- /@signatureIndex@/ in /@result@/.  See the t'GI.OSTree.Enums.GpgSignatureAttr' description
-- for the t'GI.GLib.Structs.VariantType.VariantType' of each available attribute.
-- 
-- It is a programmer error to request an invalid t'GI.OSTree.Enums.GpgSignatureAttr' or
-- an invalid /@signatureIndex@/.  Use 'GI.OSTree.Objects.GpgVerifyResult.gpgVerifyResultCountAll' to
-- find the number of signatures in /@result@/.
gpgVerifyResultGet ::
    (B.CallStack.HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
    a
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> Word32
    -- ^ /@signatureIndex@/: which signature to get attributes from
    -> [OSTree.Enums.GpgSignatureAttr]
    -- ^ /@attrs@/: Array of requested attributes
    -> m GVariant
    -- ^ __Returns:__ a new, floating, t'GVariant' tuple
gpgVerifyResultGet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
a -> Word32 -> [GpgSignatureAttr] -> m GVariant
gpgVerifyResultGet a
result_ Word32
signatureIndex [GpgSignatureAttr]
attrs = IO GVariant -> m GVariant
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
    let nAttrs :: Word32
nAttrs = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [GpgSignatureAttr] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [GpgSignatureAttr]
attrs
    Ptr GpgVerifyResult
result_' <- a -> IO (Ptr GpgVerifyResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    let attrs' :: [CUInt]
attrs' = (GpgSignatureAttr -> CUInt) -> [GpgSignatureAttr] -> [CUInt]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (GpgSignatureAttr -> Int) -> GpgSignatureAttr -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GpgSignatureAttr -> Int
forall a. Enum a => a -> Int
fromEnum) [GpgSignatureAttr]
attrs
    Ptr CUInt
attrs'' <- [CUInt] -> IO (Ptr CUInt)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [CUInt]
attrs'
    Ptr GVariant
result <- Ptr GpgVerifyResult
-> Word32 -> Ptr CUInt -> Word32 -> IO (Ptr GVariant)
ostree_gpg_verify_result_get Ptr GpgVerifyResult
result_' Word32
signatureIndex Ptr CUInt
attrs'' Word32
nAttrs
    Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"gpgVerifyResultGet" Ptr GVariant
result
    GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
attrs''
    GVariant -> IO GVariant
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'

#if defined(ENABLE_OVERLOADING)
data GpgVerifyResultGetMethodInfo
instance (signature ~ (Word32 -> [OSTree.Enums.GpgSignatureAttr] -> m GVariant), MonadIO m, IsGpgVerifyResult a) => O.OverloadedMethod GpgVerifyResultGetMethodInfo a signature where
    overloadedMethod = gpgVerifyResultGet

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


#endif

-- method GpgVerifyResult::get_all
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "GpgVerifyResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeGpgVerifyResult"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "which signature to get attributes from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just TVariant
-- throws : False
-- Skip return : False

foreign import ccall "ostree_gpg_verify_result_get_all" ostree_gpg_verify_result_get_all :: 
    Ptr GpgVerifyResult ->                  -- result : TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"})
    Word32 ->                               -- signature_index : TBasicType TUInt
    IO (Ptr GVariant)

-- | Builds a t'GVariant' tuple of all available attributes for the GPG signature
-- at /@signatureIndex@/ in /@result@/.
-- 
-- The child values in the returned t'GVariant' tuple are ordered to match the
-- t'GI.OSTree.Enums.GpgSignatureAttr' enumeration, which means the enum values can be
-- used as index values in functions like @/g_variant_get_child()/@.  See the
-- t'GI.OSTree.Enums.GpgSignatureAttr' description for the t'GI.GLib.Structs.VariantType.VariantType' of each
-- available attribute.
-- 
-- \<note>
--   \<para>
--     The t'GI.OSTree.Enums.GpgSignatureAttr' enumeration may be extended in the future
--     with new attributes, which would affect the t'GVariant' tuple returned by
--     this function.  While the position and type of current child values in
--     the t'GVariant' tuple will not change, to avoid backward-compatibility
--     issues \<emphasis>please do not depend on the tuple\'s overall size or
--     type signature\<\/emphasis>.
--   \<\/para>
-- \<\/note>
-- 
-- It is a programmer error to request an invalid /@signatureIndex@/.  Use
-- 'GI.OSTree.Objects.GpgVerifyResult.gpgVerifyResultCountAll' to find the number of signatures in
-- /@result@/.
gpgVerifyResultGetAll ::
    (B.CallStack.HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
    a
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> Word32
    -- ^ /@signatureIndex@/: which signature to get attributes from
    -> m GVariant
    -- ^ __Returns:__ a new, floating, t'GVariant' tuple
gpgVerifyResultGetAll :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
a -> Word32 -> m GVariant
gpgVerifyResultGetAll a
result_ Word32
signatureIndex = IO GVariant -> m GVariant
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
    Ptr GpgVerifyResult
result_' <- a -> IO (Ptr GpgVerifyResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    Ptr GVariant
result <- Ptr GpgVerifyResult -> Word32 -> IO (Ptr GVariant)
ostree_gpg_verify_result_get_all Ptr GpgVerifyResult
result_' Word32
signatureIndex
    Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"gpgVerifyResultGetAll" Ptr GVariant
result
    GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
    GVariant -> IO GVariant
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'

#if defined(ENABLE_OVERLOADING)
data GpgVerifyResultGetAllMethodInfo
instance (signature ~ (Word32 -> m GVariant), MonadIO m, IsGpgVerifyResult a) => O.OverloadedMethod GpgVerifyResultGetAllMethodInfo a signature where
    overloadedMethod = gpgVerifyResultGetAll

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


#endif

-- method GpgVerifyResult::lookup
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "GpgVerifyResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeGpgVerifyResult"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_id"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a GPG key ID or fingerprint"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_signature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for the index of the signature\n                             signed by @key_id, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_gpg_verify_result_lookup" ostree_gpg_verify_result_lookup :: 
    Ptr GpgVerifyResult ->                  -- result : TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"})
    CString ->                              -- key_id : TBasicType TUTF8
    Ptr Word32 ->                           -- out_signature_index : TBasicType TUInt
    IO CInt

-- | Searches /@result@/ for a signature signed by /@keyId@/.  If a match is found,
-- the function returns 'P.True' and sets /@outSignatureIndex@/ so that further
-- signature details can be obtained through 'GI.OSTree.Objects.GpgVerifyResult.gpgVerifyResultGet'.
-- If no match is found, the function returns 'P.False' and leaves
-- /@outSignatureIndex@/ unchanged.
gpgVerifyResultLookup ::
    (B.CallStack.HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
    a
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> T.Text
    -- ^ /@keyId@/: a GPG key ID or fingerprint
    -> m ((Bool, Word32))
    -- ^ __Returns:__ 'P.True' on success, 'P.False' on failure
gpgVerifyResultLookup :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
a -> Text -> m (Bool, Word32)
gpgVerifyResultLookup a
result_ Text
keyId = IO (Bool, Word32) -> m (Bool, Word32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr GpgVerifyResult
result_' <- a -> IO (Ptr GpgVerifyResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    Ptr CChar
keyId' <- Text -> IO (Ptr CChar)
textToCString Text
keyId
    Ptr Word32
outSignatureIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    CInt
result <- Ptr GpgVerifyResult -> Ptr CChar -> Ptr Word32 -> IO CInt
ostree_gpg_verify_result_lookup Ptr GpgVerifyResult
result_' Ptr CChar
keyId' Ptr Word32
outSignatureIndex
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Word32
outSignatureIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outSignatureIndex
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
keyId'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outSignatureIndex
    (Bool, Word32) -> IO (Bool, Word32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
outSignatureIndex')

#if defined(ENABLE_OVERLOADING)
data GpgVerifyResultLookupMethodInfo
instance (signature ~ (T.Text -> m ((Bool, Word32))), MonadIO m, IsGpgVerifyResult a) => O.OverloadedMethod GpgVerifyResultLookupMethodInfo a signature where
    overloadedMethod = gpgVerifyResultLookup

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


#endif

-- method GpgVerifyResult::require_valid_signature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "GpgVerifyResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeGpgVerifyResult"
--                 , 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_gpg_verify_result_require_valid_signature" ostree_gpg_verify_result_require_valid_signature :: 
    Ptr GpgVerifyResult ->                  -- result : TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Checks if the result contains at least one signature from the
-- trusted keyring.  You can call this function immediately after
-- 'GI.OSTree.Objects.Repo.repoVerifySummary' or 'GI.OSTree.Objects.Repo.repoVerifyCommitExt' -
-- it will handle the 'P.Nothing' /@result@/ and filled /@error@/ too.
-- 
-- /Since: 2016.6/
gpgVerifyResultRequireValidSignature ::
    (B.CallStack.HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
    a
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
gpgVerifyResultRequireValidSignature :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGpgVerifyResult a) =>
a -> m ()
gpgVerifyResultRequireValidSignature a
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr GpgVerifyResult
result_' <- a -> IO (Ptr GpgVerifyResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr GpgVerifyResult -> Ptr (Ptr GError) -> IO CInt
ostree_gpg_verify_result_require_valid_signature Ptr GpgVerifyResult
result_'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data GpgVerifyResultRequireValidSignatureMethodInfo
instance (signature ~ (m ()), MonadIO m, IsGpgVerifyResult a) => O.OverloadedMethod GpgVerifyResultRequireValidSignatureMethodInfo a signature where
    overloadedMethod = gpgVerifyResultRequireValidSignature

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


#endif

-- method GpgVerifyResult::describe_variant
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "variant"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GVariant from ostree_gpg_verify_result_get_all()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "output_buffer"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "String" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GString to hold the description"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line_prefix"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "optional line prefix string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "GpgSignatureFormatFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "flags to adjust the description format"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_gpg_verify_result_describe_variant" ostree_gpg_verify_result_describe_variant :: 
    Ptr GVariant ->                         -- variant : TVariant
    Ptr GLib.String.String ->               -- output_buffer : TInterface (Name {namespace = "GLib", name = "String"})
    CString ->                              -- line_prefix : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "GpgSignatureFormatFlags"})
    IO ()

-- | Similar to 'GI.OSTree.Objects.GpgVerifyResult.gpgVerifyResultDescribe' but takes a t'GVariant' of
-- all attributes for a GPG signature instead of an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
-- and signature index.
-- 
-- The /@variant@/ \<emphasis>MUST\<\/emphasis> have been created by
-- 'GI.OSTree.Objects.GpgVerifyResult.gpgVerifyResultGetAll'.
gpgVerifyResultDescribeVariant ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GVariant
    -- ^ /@variant@/: a t'GVariant' from 'GI.OSTree.Objects.GpgVerifyResult.gpgVerifyResultGetAll'
    -> GLib.String.String
    -- ^ /@outputBuffer@/: a t'GI.GLib.Structs.String.String' to hold the description
    -> Maybe (T.Text)
    -- ^ /@linePrefix@/: optional line prefix string
    -> [OSTree.Flags.GpgSignatureFormatFlags]
    -- ^ /@flags@/: flags to adjust the description format
    -> m ()
gpgVerifyResultDescribeVariant :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GVariant
-> String -> Maybe Text -> [GpgSignatureFormatFlags] -> m ()
gpgVerifyResultDescribeVariant GVariant
variant String
outputBuffer Maybe Text
linePrefix [GpgSignatureFormatFlags]
flags = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr GVariant
variant' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
variant
    Ptr String
outputBuffer' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
outputBuffer
    Ptr CChar
maybeLinePrefix <- case Maybe Text
linePrefix of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jLinePrefix -> do
            Ptr CChar
jLinePrefix' <- Text -> IO (Ptr CChar)
textToCString Text
jLinePrefix
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jLinePrefix'
    let flags' :: CUInt
flags' = [GpgSignatureFormatFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [GpgSignatureFormatFlags]
flags
    Ptr GVariant -> Ptr String -> Ptr CChar -> CUInt -> IO ()
ostree_gpg_verify_result_describe_variant Ptr GVariant
variant' Ptr String
outputBuffer' Ptr CChar
maybeLinePrefix CUInt
flags'
    GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
variant
    String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
outputBuffer
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeLinePrefix
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif