{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.OSTree.Objects.Repo
    ( 

-- * Exported types
    Repo(..)                                ,
    IsRepo                                  ,
    toRepo                                  ,
    noRepo                                  ,


 -- * Methods
-- ** Unsupported methods #method:Unsupported methods#
    RepoListCommitObjectsStartingWithMethodInfo,
    RepoListObjectsMethodInfo               ,
    RepoTraverseCommitMethodInfo            ,
    RepoTraverseNewReachableMethodInfo      ,


-- ** abortTransaction #method:abortTransaction#
    RepoAbortTransactionMethodInfo          ,
    repoAbortTransaction                    ,


-- ** addGpgSignatureSummary #method:addGpgSignatureSummary#
    RepoAddGpgSignatureSummaryMethodInfo    ,
    repoAddGpgSignatureSummary              ,


-- ** appendGpgSignature #method:appendGpgSignature#
    RepoAppendGpgSignatureMethodInfo        ,
    repoAppendGpgSignature                  ,


-- ** checkoutAt #method:checkoutAt#
    RepoCheckoutAtMethodInfo                ,
    repoCheckoutAt                          ,


-- ** checkoutGc #method:checkoutGc#
    RepoCheckoutGcMethodInfo                ,
    repoCheckoutGc                          ,


-- ** checkoutTree #method:checkoutTree#
    RepoCheckoutTreeMethodInfo              ,
    repoCheckoutTree                        ,


-- ** commitTransaction #method:commitTransaction#
    RepoCommitTransactionMethodInfo         ,
    repoCommitTransaction                   ,


-- ** copyConfig #method:copyConfig#
    RepoCopyConfigMethodInfo                ,
    repoCopyConfig                          ,


-- ** create #method:create#
    RepoCreateMethodInfo                    ,
    repoCreate                              ,


-- ** deleteObject #method:deleteObject#
    RepoDeleteObjectMethodInfo              ,
    repoDeleteObject                        ,


-- ** getConfig #method:getConfig#
    RepoGetConfigMethodInfo                 ,
    repoGetConfig                           ,


-- ** getDfd #method:getDfd#
    RepoGetDfdMethodInfo                    ,
    repoGetDfd                              ,


-- ** getDisableFsync #method:getDisableFsync#
    RepoGetDisableFsyncMethodInfo           ,
    repoGetDisableFsync                     ,


-- ** getMode #method:getMode#
    RepoGetModeMethodInfo                   ,
    repoGetMode                             ,


-- ** getParent #method:getParent#
    RepoGetParentMethodInfo                 ,
    repoGetParent                           ,


-- ** getPath #method:getPath#
    RepoGetPathMethodInfo                   ,
    repoGetPath                             ,


-- ** getRemoteBooleanOption #method:getRemoteBooleanOption#
    RepoGetRemoteBooleanOptionMethodInfo    ,
    repoGetRemoteBooleanOption              ,


-- ** getRemoteListOption #method:getRemoteListOption#
    RepoGetRemoteListOptionMethodInfo       ,
    repoGetRemoteListOption                 ,


-- ** getRemoteOption #method:getRemoteOption#
    RepoGetRemoteOptionMethodInfo           ,
    repoGetRemoteOption                     ,


-- ** gpgVerifyData #method:gpgVerifyData#
    RepoGpgVerifyDataMethodInfo             ,
    repoGpgVerifyData                       ,


-- ** hasObject #method:hasObject#
    RepoHasObjectMethodInfo                 ,
    repoHasObject                           ,


-- ** importObjectFrom #method:importObjectFrom#
    RepoImportObjectFromMethodInfo          ,
    repoImportObjectFrom                    ,


-- ** importObjectFromWithTrust #method:importObjectFromWithTrust#
    RepoImportObjectFromWithTrustMethodInfo ,
    repoImportObjectFromWithTrust           ,


-- ** isSystem #method:isSystem#
    RepoIsSystemMethodInfo                  ,
    repoIsSystem                            ,


-- ** isWritable #method:isWritable#
    RepoIsWritableMethodInfo                ,
    repoIsWritable                          ,


-- ** listRefs #method:listRefs#
    RepoListRefsMethodInfo                  ,
    repoListRefs                            ,


-- ** listRefsExt #method:listRefsExt#
    RepoListRefsExtMethodInfo               ,
    repoListRefsExt                         ,


-- ** listStaticDeltaNames #method:listStaticDeltaNames#
    RepoListStaticDeltaNamesMethodInfo      ,
    repoListStaticDeltaNames                ,


-- ** loadCommit #method:loadCommit#
    RepoLoadCommitMethodInfo                ,
    repoLoadCommit                          ,


-- ** loadFile #method:loadFile#
    RepoLoadFileMethodInfo                  ,
    repoLoadFile                            ,


-- ** loadObjectStream #method:loadObjectStream#
    RepoLoadObjectStreamMethodInfo          ,
    repoLoadObjectStream                    ,


-- ** loadVariant #method:loadVariant#
    RepoLoadVariantMethodInfo               ,
    repoLoadVariant                         ,


-- ** loadVariantIfExists #method:loadVariantIfExists#
    RepoLoadVariantIfExistsMethodInfo       ,
    repoLoadVariantIfExists                 ,


-- ** modeFromString #method:modeFromString#
    repoModeFromString                      ,


-- ** new #method:new#
    repoNew                                 ,


-- ** newDefault #method:newDefault#
    repoNewDefault                          ,


-- ** newForSysrootPath #method:newForSysrootPath#
    repoNewForSysrootPath                   ,


-- ** open #method:open#
    RepoOpenMethodInfo                      ,
    repoOpen                                ,


-- ** prepareTransaction #method:prepareTransaction#
    RepoPrepareTransactionMethodInfo        ,
    repoPrepareTransaction                  ,


-- ** prune #method:prune#
    RepoPruneMethodInfo                     ,
    repoPrune                               ,


-- ** pruneFromReachable #method:pruneFromReachable#
    RepoPruneFromReachableMethodInfo        ,
    repoPruneFromReachable                  ,


-- ** pruneStaticDeltas #method:pruneStaticDeltas#
    RepoPruneStaticDeltasMethodInfo         ,
    repoPruneStaticDeltas                   ,


-- ** pull #method:pull#
    RepoPullMethodInfo                      ,
    repoPull                                ,


-- ** pullDefaultConsoleProgressChanged #method:pullDefaultConsoleProgressChanged#
    repoPullDefaultConsoleProgressChanged   ,


-- ** pullOneDir #method:pullOneDir#
    RepoPullOneDirMethodInfo                ,
    repoPullOneDir                          ,


-- ** pullWithOptions #method:pullWithOptions#
    RepoPullWithOptionsMethodInfo           ,
    repoPullWithOptions                     ,


-- ** queryObjectStorageSize #method:queryObjectStorageSize#
    RepoQueryObjectStorageSizeMethodInfo    ,
    repoQueryObjectStorageSize              ,


-- ** readCommit #method:readCommit#
    RepoReadCommitMethodInfo                ,
    repoReadCommit                          ,


-- ** readCommitDetachedMetadata #method:readCommitDetachedMetadata#
    RepoReadCommitDetachedMetadataMethodInfo,
    repoReadCommitDetachedMetadata          ,


-- ** regenerateSummary #method:regenerateSummary#
    RepoRegenerateSummaryMethodInfo         ,
    repoRegenerateSummary                   ,


-- ** reloadConfig #method:reloadConfig#
    RepoReloadConfigMethodInfo              ,
    repoReloadConfig                        ,


-- ** remoteAdd #method:remoteAdd#
    RepoRemoteAddMethodInfo                 ,
    repoRemoteAdd                           ,


-- ** remoteChange #method:remoteChange#
    RepoRemoteChangeMethodInfo              ,
    repoRemoteChange                        ,


-- ** remoteDelete #method:remoteDelete#
    RepoRemoteDeleteMethodInfo              ,
    repoRemoteDelete                        ,


-- ** remoteFetchSummary #method:remoteFetchSummary#
    RepoRemoteFetchSummaryMethodInfo        ,
    repoRemoteFetchSummary                  ,


-- ** remoteFetchSummaryWithOptions #method:remoteFetchSummaryWithOptions#
    RepoRemoteFetchSummaryWithOptionsMethodInfo,
    repoRemoteFetchSummaryWithOptions       ,


-- ** remoteGetGpgVerify #method:remoteGetGpgVerify#
    RepoRemoteGetGpgVerifyMethodInfo        ,
    repoRemoteGetGpgVerify                  ,


-- ** remoteGetGpgVerifySummary #method:remoteGetGpgVerifySummary#
    RepoRemoteGetGpgVerifySummaryMethodInfo ,
    repoRemoteGetGpgVerifySummary           ,


-- ** remoteGetUrl #method:remoteGetUrl#
    RepoRemoteGetUrlMethodInfo              ,
    repoRemoteGetUrl                        ,


-- ** remoteGpgImport #method:remoteGpgImport#
    RepoRemoteGpgImportMethodInfo           ,
    repoRemoteGpgImport                     ,


-- ** remoteList #method:remoteList#
    RepoRemoteListMethodInfo                ,
    repoRemoteList                          ,


-- ** remoteListRefs #method:remoteListRefs#
    RepoRemoteListRefsMethodInfo            ,
    repoRemoteListRefs                      ,


-- ** resolveRev #method:resolveRev#
    RepoResolveRevMethodInfo                ,
    repoResolveRev                          ,


-- ** resolveRevExt #method:resolveRevExt#
    RepoResolveRevExtMethodInfo             ,
    repoResolveRevExt                       ,


-- ** scanHardlinks #method:scanHardlinks#
    RepoScanHardlinksMethodInfo             ,
    repoScanHardlinks                       ,


-- ** setCacheDir #method:setCacheDir#
    RepoSetCacheDirMethodInfo               ,
    repoSetCacheDir                         ,


-- ** setDisableFsync #method:setDisableFsync#
    RepoSetDisableFsyncMethodInfo           ,
    repoSetDisableFsync                     ,


-- ** setRefImmediate #method:setRefImmediate#
    RepoSetRefImmediateMethodInfo           ,
    repoSetRefImmediate                     ,


-- ** signCommit #method:signCommit#
    RepoSignCommitMethodInfo                ,
    repoSignCommit                          ,


-- ** signDelta #method:signDelta#
    RepoSignDeltaMethodInfo                 ,
    repoSignDelta                           ,


-- ** staticDeltaExecuteOffline #method:staticDeltaExecuteOffline#
    RepoStaticDeltaExecuteOfflineMethodInfo ,
    repoStaticDeltaExecuteOffline           ,


-- ** staticDeltaGenerate #method:staticDeltaGenerate#
    RepoStaticDeltaGenerateMethodInfo       ,
    repoStaticDeltaGenerate                 ,


-- ** transactionSetRef #method:transactionSetRef#
    RepoTransactionSetRefMethodInfo         ,
    repoTransactionSetRef                   ,


-- ** transactionSetRefspec #method:transactionSetRefspec#
    RepoTransactionSetRefspecMethodInfo     ,
    repoTransactionSetRefspec               ,


-- ** verifyCommit #method:verifyCommit#
    RepoVerifyCommitMethodInfo              ,
    repoVerifyCommit                        ,


-- ** verifyCommitExt #method:verifyCommitExt#
    RepoVerifyCommitExtMethodInfo           ,
    repoVerifyCommitExt                     ,


-- ** verifyCommitForRemote #method:verifyCommitForRemote#
    RepoVerifyCommitForRemoteMethodInfo     ,
    repoVerifyCommitForRemote               ,


-- ** verifySummary #method:verifySummary#
    RepoVerifySummaryMethodInfo             ,
    repoVerifySummary                       ,


-- ** writeArchiveToMtree #method:writeArchiveToMtree#
    RepoWriteArchiveToMtreeMethodInfo       ,
    repoWriteArchiveToMtree                 ,


-- ** writeCommit #method:writeCommit#
    RepoWriteCommitMethodInfo               ,
    repoWriteCommit                         ,


-- ** writeCommitDetachedMetadata #method:writeCommitDetachedMetadata#
    RepoWriteCommitDetachedMetadataMethodInfo,
    repoWriteCommitDetachedMetadata         ,


-- ** writeCommitWithTime #method:writeCommitWithTime#
    RepoWriteCommitWithTimeMethodInfo       ,
    repoWriteCommitWithTime                 ,


-- ** writeConfig #method:writeConfig#
    RepoWriteConfigMethodInfo               ,
    repoWriteConfig                         ,


-- ** writeContent #method:writeContent#
    RepoWriteContentMethodInfo              ,
    repoWriteContent                        ,


-- ** writeContentAsync #method:writeContentAsync#
    RepoWriteContentAsyncMethodInfo         ,
    repoWriteContentAsync                   ,


-- ** writeContentFinish #method:writeContentFinish#
    RepoWriteContentFinishMethodInfo        ,
    repoWriteContentFinish                  ,


-- ** writeContentTrusted #method:writeContentTrusted#
    RepoWriteContentTrustedMethodInfo       ,
    repoWriteContentTrusted                 ,


-- ** writeDfdToMtree #method:writeDfdToMtree#
    RepoWriteDfdToMtreeMethodInfo           ,
    repoWriteDfdToMtree                     ,


-- ** writeDirectoryToMtree #method:writeDirectoryToMtree#
    RepoWriteDirectoryToMtreeMethodInfo     ,
    repoWriteDirectoryToMtree               ,


-- ** writeMetadata #method:writeMetadata#
    RepoWriteMetadataMethodInfo             ,
    repoWriteMetadata                       ,


-- ** writeMetadataAsync #method:writeMetadataAsync#
    RepoWriteMetadataAsyncMethodInfo        ,
    repoWriteMetadataAsync                  ,


-- ** writeMetadataFinish #method:writeMetadataFinish#
    RepoWriteMetadataFinishMethodInfo       ,
    repoWriteMetadataFinish                 ,


-- ** writeMetadataStreamTrusted #method:writeMetadataStreamTrusted#
    RepoWriteMetadataStreamTrustedMethodInfo,
    repoWriteMetadataStreamTrusted          ,


-- ** writeMetadataTrusted #method:writeMetadataTrusted#
    RepoWriteMetadataTrustedMethodInfo      ,
    repoWriteMetadataTrusted                ,


-- ** writeMtree #method:writeMtree#
    RepoWriteMtreeMethodInfo                ,
    repoWriteMtree                          ,




 -- * Properties
-- ** path #attr:path#
    RepoPathPropertyInfo                    ,
    constructRepoPath                       ,
    getRepoPath                             ,
    repoPath                                ,


-- ** remotesConfigDir #attr:remotesConfigDir#
    RepoRemotesConfigDirPropertyInfo        ,
    constructRepoRemotesConfigDir           ,
    getRepoRemotesConfigDir                 ,
    repoRemotesConfigDir                    ,


-- ** sysrootPath #attr:sysrootPath#
    RepoSysrootPathPropertyInfo             ,
    constructRepoSysrootPath                ,
    getRepoSysrootPath                      ,
    repoSysrootPath                         ,




 -- * Signals
-- ** gpgVerifyResult #signal:gpgVerifyResult#
    C_RepoGpgVerifyResultCallback           ,
    RepoGpgVerifyResultCallback             ,
    RepoGpgVerifyResultSignalInfo           ,
    afterRepoGpgVerifyResult                ,
    genClosure_RepoGpgVerifyResult          ,
    mk_RepoGpgVerifyResultCallback          ,
    noRepoGpgVerifyResultCallback           ,
    onRepoGpgVerifyResult                   ,
    wrap_RepoGpgVerifyResultCallback        ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.GpgVerifyResult as OSTree.GpgVerifyResult
import {-# SOURCE #-} qualified GI.OSTree.Objects.MutableTree as OSTree.MutableTree
import {-# SOURCE #-} qualified GI.OSTree.Objects.RepoFile as OSTree.RepoFile
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCheckoutAtOptions as OSTree.RepoCheckoutAtOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCommitModifier as OSTree.RepoCommitModifier
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats

newtype Repo = Repo (ManagedPtr Repo)
foreign import ccall "ostree_repo_get_type"
    c_ostree_repo_get_type :: IO GType

instance GObject Repo where
    gobjectType _ = c_ostree_repo_get_type
    

class GObject o => IsRepo o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Repo a) =>
    IsRepo a
#endif
instance IsRepo Repo
instance GObject.Object.IsObject Repo

toRepo :: IsRepo o => o -> IO Repo
toRepo = unsafeCastTo Repo

noRepo :: Maybe Repo
noRepo = Nothing

type family ResolveRepoMethod (t :: Symbol) (o :: *) :: * where
    ResolveRepoMethod "abortTransaction" o = RepoAbortTransactionMethodInfo
    ResolveRepoMethod "addGpgSignatureSummary" o = RepoAddGpgSignatureSummaryMethodInfo
    ResolveRepoMethod "appendGpgSignature" o = RepoAppendGpgSignatureMethodInfo
    ResolveRepoMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveRepoMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveRepoMethod "checkoutAt" o = RepoCheckoutAtMethodInfo
    ResolveRepoMethod "checkoutGc" o = RepoCheckoutGcMethodInfo
    ResolveRepoMethod "checkoutTree" o = RepoCheckoutTreeMethodInfo
    ResolveRepoMethod "commitTransaction" o = RepoCommitTransactionMethodInfo
    ResolveRepoMethod "copyConfig" o = RepoCopyConfigMethodInfo
    ResolveRepoMethod "create" o = RepoCreateMethodInfo
    ResolveRepoMethod "deleteObject" o = RepoDeleteObjectMethodInfo
    ResolveRepoMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveRepoMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveRepoMethod "gpgVerifyData" o = RepoGpgVerifyDataMethodInfo
    ResolveRepoMethod "hasObject" o = RepoHasObjectMethodInfo
    ResolveRepoMethod "importObjectFrom" o = RepoImportObjectFromMethodInfo
    ResolveRepoMethod "importObjectFromWithTrust" o = RepoImportObjectFromWithTrustMethodInfo
    ResolveRepoMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveRepoMethod "isSystem" o = RepoIsSystemMethodInfo
    ResolveRepoMethod "isWritable" o = RepoIsWritableMethodInfo
    ResolveRepoMethod "listCommitObjectsStartingWith" o = RepoListCommitObjectsStartingWithMethodInfo
    ResolveRepoMethod "listObjects" o = RepoListObjectsMethodInfo
    ResolveRepoMethod "listRefs" o = RepoListRefsMethodInfo
    ResolveRepoMethod "listRefsExt" o = RepoListRefsExtMethodInfo
    ResolveRepoMethod "listStaticDeltaNames" o = RepoListStaticDeltaNamesMethodInfo
    ResolveRepoMethod "loadCommit" o = RepoLoadCommitMethodInfo
    ResolveRepoMethod "loadFile" o = RepoLoadFileMethodInfo
    ResolveRepoMethod "loadObjectStream" o = RepoLoadObjectStreamMethodInfo
    ResolveRepoMethod "loadVariant" o = RepoLoadVariantMethodInfo
    ResolveRepoMethod "loadVariantIfExists" o = RepoLoadVariantIfExistsMethodInfo
    ResolveRepoMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveRepoMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveRepoMethod "open" o = RepoOpenMethodInfo
    ResolveRepoMethod "prepareTransaction" o = RepoPrepareTransactionMethodInfo
    ResolveRepoMethod "prune" o = RepoPruneMethodInfo
    ResolveRepoMethod "pruneFromReachable" o = RepoPruneFromReachableMethodInfo
    ResolveRepoMethod "pruneStaticDeltas" o = RepoPruneStaticDeltasMethodInfo
    ResolveRepoMethod "pull" o = RepoPullMethodInfo
    ResolveRepoMethod "pullOneDir" o = RepoPullOneDirMethodInfo
    ResolveRepoMethod "pullWithOptions" o = RepoPullWithOptionsMethodInfo
    ResolveRepoMethod "queryObjectStorageSize" o = RepoQueryObjectStorageSizeMethodInfo
    ResolveRepoMethod "readCommit" o = RepoReadCommitMethodInfo
    ResolveRepoMethod "readCommitDetachedMetadata" o = RepoReadCommitDetachedMetadataMethodInfo
    ResolveRepoMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveRepoMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveRepoMethod "regenerateSummary" o = RepoRegenerateSummaryMethodInfo
    ResolveRepoMethod "reloadConfig" o = RepoReloadConfigMethodInfo
    ResolveRepoMethod "remoteAdd" o = RepoRemoteAddMethodInfo
    ResolveRepoMethod "remoteChange" o = RepoRemoteChangeMethodInfo
    ResolveRepoMethod "remoteDelete" o = RepoRemoteDeleteMethodInfo
    ResolveRepoMethod "remoteFetchSummary" o = RepoRemoteFetchSummaryMethodInfo
    ResolveRepoMethod "remoteFetchSummaryWithOptions" o = RepoRemoteFetchSummaryWithOptionsMethodInfo
    ResolveRepoMethod "remoteGetGpgVerify" o = RepoRemoteGetGpgVerifyMethodInfo
    ResolveRepoMethod "remoteGetGpgVerifySummary" o = RepoRemoteGetGpgVerifySummaryMethodInfo
    ResolveRepoMethod "remoteGetUrl" o = RepoRemoteGetUrlMethodInfo
    ResolveRepoMethod "remoteGpgImport" o = RepoRemoteGpgImportMethodInfo
    ResolveRepoMethod "remoteList" o = RepoRemoteListMethodInfo
    ResolveRepoMethod "remoteListRefs" o = RepoRemoteListRefsMethodInfo
    ResolveRepoMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveRepoMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveRepoMethod "resolveRev" o = RepoResolveRevMethodInfo
    ResolveRepoMethod "resolveRevExt" o = RepoResolveRevExtMethodInfo
    ResolveRepoMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveRepoMethod "scanHardlinks" o = RepoScanHardlinksMethodInfo
    ResolveRepoMethod "signCommit" o = RepoSignCommitMethodInfo
    ResolveRepoMethod "signDelta" o = RepoSignDeltaMethodInfo
    ResolveRepoMethod "staticDeltaExecuteOffline" o = RepoStaticDeltaExecuteOfflineMethodInfo
    ResolveRepoMethod "staticDeltaGenerate" o = RepoStaticDeltaGenerateMethodInfo
    ResolveRepoMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveRepoMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveRepoMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveRepoMethod "transactionSetRef" o = RepoTransactionSetRefMethodInfo
    ResolveRepoMethod "transactionSetRefspec" o = RepoTransactionSetRefspecMethodInfo
    ResolveRepoMethod "traverseCommit" o = RepoTraverseCommitMethodInfo
    ResolveRepoMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveRepoMethod "verifyCommit" o = RepoVerifyCommitMethodInfo
    ResolveRepoMethod "verifyCommitExt" o = RepoVerifyCommitExtMethodInfo
    ResolveRepoMethod "verifyCommitForRemote" o = RepoVerifyCommitForRemoteMethodInfo
    ResolveRepoMethod "verifySummary" o = RepoVerifySummaryMethodInfo
    ResolveRepoMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveRepoMethod "writeArchiveToMtree" o = RepoWriteArchiveToMtreeMethodInfo
    ResolveRepoMethod "writeCommit" o = RepoWriteCommitMethodInfo
    ResolveRepoMethod "writeCommitDetachedMetadata" o = RepoWriteCommitDetachedMetadataMethodInfo
    ResolveRepoMethod "writeCommitWithTime" o = RepoWriteCommitWithTimeMethodInfo
    ResolveRepoMethod "writeConfig" o = RepoWriteConfigMethodInfo
    ResolveRepoMethod "writeContent" o = RepoWriteContentMethodInfo
    ResolveRepoMethod "writeContentAsync" o = RepoWriteContentAsyncMethodInfo
    ResolveRepoMethod "writeContentFinish" o = RepoWriteContentFinishMethodInfo
    ResolveRepoMethod "writeContentTrusted" o = RepoWriteContentTrustedMethodInfo
    ResolveRepoMethod "writeDfdToMtree" o = RepoWriteDfdToMtreeMethodInfo
    ResolveRepoMethod "writeDirectoryToMtree" o = RepoWriteDirectoryToMtreeMethodInfo
    ResolveRepoMethod "writeMetadata" o = RepoWriteMetadataMethodInfo
    ResolveRepoMethod "writeMetadataAsync" o = RepoWriteMetadataAsyncMethodInfo
    ResolveRepoMethod "writeMetadataFinish" o = RepoWriteMetadataFinishMethodInfo
    ResolveRepoMethod "writeMetadataStreamTrusted" o = RepoWriteMetadataStreamTrustedMethodInfo
    ResolveRepoMethod "writeMetadataTrusted" o = RepoWriteMetadataTrustedMethodInfo
    ResolveRepoMethod "writeMtree" o = RepoWriteMtreeMethodInfo
    ResolveRepoMethod "getConfig" o = RepoGetConfigMethodInfo
    ResolveRepoMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveRepoMethod "getDfd" o = RepoGetDfdMethodInfo
    ResolveRepoMethod "getDisableFsync" o = RepoGetDisableFsyncMethodInfo
    ResolveRepoMethod "getMode" o = RepoGetModeMethodInfo
    ResolveRepoMethod "getParent" o = RepoGetParentMethodInfo
    ResolveRepoMethod "getPath" o = RepoGetPathMethodInfo
    ResolveRepoMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveRepoMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveRepoMethod "getRemoteBooleanOption" o = RepoGetRemoteBooleanOptionMethodInfo
    ResolveRepoMethod "getRemoteListOption" o = RepoGetRemoteListOptionMethodInfo
    ResolveRepoMethod "getRemoteOption" o = RepoGetRemoteOptionMethodInfo
    ResolveRepoMethod "setCacheDir" o = RepoSetCacheDirMethodInfo
    ResolveRepoMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveRepoMethod "setDisableFsync" o = RepoSetDisableFsyncMethodInfo
    ResolveRepoMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveRepoMethod "setRefImmediate" o = RepoSetRefImmediateMethodInfo
    ResolveRepoMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveRepoMethod t Repo, O.MethodInfo info Repo p) => O.IsLabelProxy t (Repo -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveRepoMethod t Repo, O.MethodInfo info Repo p) => O.IsLabel t (Repo -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- signal Repo::gpg-verify-result
type RepoGpgVerifyResultCallback =
    T.Text ->
    OSTree.GpgVerifyResult.GpgVerifyResult ->
    IO ()

noRepoGpgVerifyResultCallback :: Maybe RepoGpgVerifyResultCallback
noRepoGpgVerifyResultCallback = Nothing

type C_RepoGpgVerifyResultCallback =
    Ptr () ->                               -- object
    CString ->
    Ptr OSTree.GpgVerifyResult.GpgVerifyResult ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_RepoGpgVerifyResultCallback :: C_RepoGpgVerifyResultCallback -> IO (FunPtr C_RepoGpgVerifyResultCallback)

genClosure_RepoGpgVerifyResult :: RepoGpgVerifyResultCallback -> IO Closure
genClosure_RepoGpgVerifyResult cb = do
    let cb' = wrap_RepoGpgVerifyResultCallback cb
    mk_RepoGpgVerifyResultCallback cb' >>= newCClosure


wrap_RepoGpgVerifyResultCallback ::
    RepoGpgVerifyResultCallback ->
    Ptr () ->
    CString ->
    Ptr OSTree.GpgVerifyResult.GpgVerifyResult ->
    Ptr () ->
    IO ()
wrap_RepoGpgVerifyResultCallback _cb _ checksum result_ _ = do
    checksum' <- cstringToText checksum
    result_' <- (newObject OSTree.GpgVerifyResult.GpgVerifyResult) result_
    _cb  checksum' result_'


onRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> RepoGpgVerifyResultCallback -> m SignalHandlerId
onRepoGpgVerifyResult obj cb = liftIO $ do
    let cb' = wrap_RepoGpgVerifyResultCallback cb
    cb'' <- mk_RepoGpgVerifyResultCallback cb'
    connectSignalFunPtr obj "gpg-verify-result" cb'' SignalConnectBefore

afterRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> RepoGpgVerifyResultCallback -> m SignalHandlerId
afterRepoGpgVerifyResult obj cb = liftIO $ do
    let cb' = wrap_RepoGpgVerifyResultCallback cb
    cb'' <- mk_RepoGpgVerifyResultCallback cb'
    connectSignalFunPtr obj "gpg-verify-result" cb'' SignalConnectAfter


-- VVV Prop "path"
   -- Type: TInterface (Name {namespace = "Gio", name = "File"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getRepoPath :: (MonadIO m, IsRepo o) => o -> m Gio.File.File
getRepoPath obj = liftIO $ checkUnexpectedNothing "getRepoPath" $ getObjectPropertyObject obj "path" Gio.File.File

constructRepoPath :: (IsRepo o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructRepoPath val = constructObjectPropertyObject "path" (Just val)

data RepoPathPropertyInfo
instance AttrInfo RepoPathPropertyInfo where
    type AttrAllowedOps RepoPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint RepoPathPropertyInfo = Gio.File.IsFile
    type AttrBaseTypeConstraint RepoPathPropertyInfo = IsRepo
    type AttrGetType RepoPathPropertyInfo = Gio.File.File
    type AttrLabel RepoPathPropertyInfo = "path"
    type AttrOrigin RepoPathPropertyInfo = Repo
    attrGet _ = getRepoPath
    attrSet _ = undefined
    attrConstruct _ = constructRepoPath
    attrClear _ = undefined

-- VVV Prop "remotes-config-dir"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getRepoRemotesConfigDir :: (MonadIO m, IsRepo o) => o -> m (Maybe T.Text)
getRepoRemotesConfigDir obj = liftIO $ getObjectPropertyString obj "remotes-config-dir"

constructRepoRemotesConfigDir :: (IsRepo o) => T.Text -> IO (GValueConstruct o)
constructRepoRemotesConfigDir val = constructObjectPropertyString "remotes-config-dir" (Just val)

data RepoRemotesConfigDirPropertyInfo
instance AttrInfo RepoRemotesConfigDirPropertyInfo where
    type AttrAllowedOps RepoRemotesConfigDirPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint RepoRemotesConfigDirPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint RepoRemotesConfigDirPropertyInfo = IsRepo
    type AttrGetType RepoRemotesConfigDirPropertyInfo = (Maybe T.Text)
    type AttrLabel RepoRemotesConfigDirPropertyInfo = "remotes-config-dir"
    type AttrOrigin RepoRemotesConfigDirPropertyInfo = Repo
    attrGet _ = getRepoRemotesConfigDir
    attrSet _ = undefined
    attrConstruct _ = constructRepoRemotesConfigDir
    attrClear _ = undefined

-- VVV Prop "sysroot-path"
   -- Type: TInterface (Name {namespace = "Gio", name = "File"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getRepoSysrootPath :: (MonadIO m, IsRepo o) => o -> m (Maybe Gio.File.File)
getRepoSysrootPath obj = liftIO $ getObjectPropertyObject obj "sysroot-path" Gio.File.File

constructRepoSysrootPath :: (IsRepo o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructRepoSysrootPath val = constructObjectPropertyObject "sysroot-path" (Just val)

data RepoSysrootPathPropertyInfo
instance AttrInfo RepoSysrootPathPropertyInfo where
    type AttrAllowedOps RepoSysrootPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint RepoSysrootPathPropertyInfo = Gio.File.IsFile
    type AttrBaseTypeConstraint RepoSysrootPathPropertyInfo = IsRepo
    type AttrGetType RepoSysrootPathPropertyInfo = (Maybe Gio.File.File)
    type AttrLabel RepoSysrootPathPropertyInfo = "sysroot-path"
    type AttrOrigin RepoSysrootPathPropertyInfo = Repo
    attrGet _ = getRepoSysrootPath
    attrSet _ = undefined
    attrConstruct _ = constructRepoSysrootPath
    attrClear _ = undefined

instance O.HasAttributeList Repo
type instance O.AttributeList Repo = RepoAttributeList
type RepoAttributeList = ('[ '("path", RepoPathPropertyInfo), '("remotesConfigDir", RepoRemotesConfigDirPropertyInfo), '("sysrootPath", RepoSysrootPathPropertyInfo)] :: [(Symbol, *)])

repoPath :: AttrLabelProxy "path"
repoPath = AttrLabelProxy

repoRemotesConfigDir :: AttrLabelProxy "remotesConfigDir"
repoRemotesConfigDir = AttrLabelProxy

repoSysrootPath :: AttrLabelProxy "sysrootPath"
repoSysrootPath = AttrLabelProxy

data RepoGpgVerifyResultSignalInfo
instance SignalInfo RepoGpgVerifyResultSignalInfo where
    type HaskellCallbackType RepoGpgVerifyResultSignalInfo = RepoGpgVerifyResultCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_RepoGpgVerifyResultCallback cb
        cb'' <- mk_RepoGpgVerifyResultCallback cb'
        connectSignalFunPtr obj "gpg-verify-result" cb'' connectMode

type instance O.SignalList Repo = RepoSignalList
type RepoSignalList = ('[ '("gpgVerifyResult", RepoGpgVerifyResultSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method Repo::new
-- method type : Constructor
-- Args : [Arg {argCName = "path", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Path to a repository", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "OSTree", name = "Repo"}))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_new" ostree_repo_new :: 
    Ptr Gio.File.File ->                    -- path : TInterface (Name {namespace = "Gio", name = "File"})
    IO (Ptr Repo)

{- |
/No description available in the introspection data./
-}
repoNew ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) =>
    a
    {- ^ /@path@/: Path to a repository -}
    -> m Repo
    {- ^ __Returns:__ An accessor object for an OSTree repository located at /@path@/ -}
repoNew path = liftIO $ do
    path' <- unsafeManagedPtrCastPtr path
    result <- ostree_repo_new path'
    checkUnexpectedReturnNULL "repoNew" result
    result' <- (wrapObject Repo) result
    touchManagedPtr path
    return result'

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

foreign import ccall "ostree_repo_new_default" ostree_repo_new_default :: 
    IO (Ptr Repo)

{- |
If the current working directory appears to be an OSTree
repository, create a new 'GI.OSTree.Objects.Repo.Repo' object for accessing it.
Otherwise use the path in the OSTREE_REPO environment variable
(if defined) or else the default system repository located at
\/ostree\/repo.
-}
repoNewDefault ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Repo
    {- ^ __Returns:__ An accessor object for an OSTree repository located at \/ostree\/repo -}
repoNewDefault  = liftIO $ do
    result <- ostree_repo_new_default
    checkUnexpectedReturnNULL "repoNewDefault" result
    result' <- (wrapObject Repo) result
    return result'

-- method Repo::new_for_sysroot_path
-- method type : Constructor
-- Args : [Arg {argCName = "repo_path", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Path to a repository", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sysroot_path", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Path to the system root", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "OSTree", name = "Repo"}))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_new_for_sysroot_path" ostree_repo_new_for_sysroot_path :: 
    Ptr Gio.File.File ->                    -- repo_path : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.File.File ->                    -- sysroot_path : TInterface (Name {namespace = "Gio", name = "File"})
    IO (Ptr Repo)

{- |
Creates a new 'GI.OSTree.Objects.Repo.Repo' instance, taking the system root path explicitly
instead of assuming \"\/\".
-}
repoNewForSysrootPath ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a, Gio.File.IsFile b) =>
    a
    {- ^ /@repoPath@/: Path to a repository -}
    -> b
    {- ^ /@sysrootPath@/: Path to the system root -}
    -> m Repo
    {- ^ __Returns:__ An accessor object for the OSTree repository located at /@repoPath@/. -}
repoNewForSysrootPath repoPath sysrootPath = liftIO $ do
    repoPath' <- unsafeManagedPtrCastPtr repoPath
    sysrootPath' <- unsafeManagedPtrCastPtr sysrootPath
    result <- ostree_repo_new_for_sysroot_path repoPath' sysrootPath'
    checkUnexpectedReturnNULL "repoNewForSysrootPath" result
    result' <- (wrapObject Repo) result
    touchManagedPtr repoPath
    touchManagedPtr sysrootPath
    return result'

-- method Repo::abort_transaction
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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 = Nothing, 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_repo_abort_transaction" ostree_repo_abort_transaction :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
/No description available in the introspection data./
-}
repoAbortTransaction ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -> Maybe (b)
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoAbortTransaction self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_abort_transaction self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoAbortTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoAbortTransactionMethodInfo a signature where
    overloadedMethod _ = repoAbortTransaction

-- method Repo::add_gpg_signature_summary
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Self", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key_id", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "NULL-terminated array of GPG keys.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "homedir", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "GPG home directory, or %NULL", 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_repo_add_gpg_signature_summary" ostree_repo_add_gpg_signature_summary :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr CString ->                          -- key_id : TCArray True (-1) (-1) (TBasicType TUTF8)
    CString ->                              -- homedir : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Add a GPG signature to a static delta.
-}
repoAddGpgSignatureSummary ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Self -}
    -> [T.Text]
    {- ^ /@keyId@/: NULL-terminated array of GPG keys. -}
    -> Maybe (T.Text)
    {- ^ /@homedir@/: GPG home directory, or 'Nothing' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoAddGpgSignatureSummary self keyId homedir cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    keyId' <- packZeroTerminatedUTF8CArray keyId
    maybeHomedir <- case homedir of
        Nothing -> return nullPtr
        Just jHomedir -> do
            jHomedir' <- textToCString jHomedir
            return jHomedir'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_add_gpg_signature_summary self' keyId' maybeHomedir maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        mapZeroTerminatedCArray freeMem keyId'
        freeMem keyId'
        freeMem maybeHomedir
        return ()
     ) (do
        mapZeroTerminatedCArray freeMem keyId'
        freeMem keyId'
        freeMem maybeHomedir
     )

data RepoAddGpgSignatureSummaryMethodInfo
instance (signature ~ ([T.Text] -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoAddGpgSignatureSummaryMethodInfo a signature where
    overloadedMethod _ = repoAddGpgSignatureSummary

-- method Repo::append_gpg_signature
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Self", 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 = "signature_bytes", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Signature data", 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_repo_append_gpg_signature" ostree_repo_append_gpg_signature :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    Ptr GLib.Bytes.Bytes ->                 -- signature_bytes : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Append a GPG signature to a commit.
-}
repoAppendGpgSignature ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Self -}
    -> T.Text
    {- ^ /@commitChecksum@/: SHA256 of given commit to sign -}
    -> GLib.Bytes.Bytes
    {- ^ /@signatureBytes@/: Signature data -}
    -> Maybe (b)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoAppendGpgSignature self commitChecksum signatureBytes cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    commitChecksum' <- textToCString commitChecksum
    signatureBytes' <- unsafeManagedPtrGetPtr signatureBytes
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_append_gpg_signature self' commitChecksum' signatureBytes' maybeCancellable
        touchManagedPtr self
        touchManagedPtr signatureBytes
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        return ()
     ) (do
        freeMem commitChecksum'
     )

data RepoAppendGpgSignatureMethodInfo
instance (signature ~ (T.Text -> GLib.Bytes.Bytes -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoAppendGpgSignatureMethodInfo a signature where
    overloadedMethod _ = repoAppendGpgSignature

-- method Repo::checkout_at
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TInterface (Name {namespace = "OSTree", name = "RepoCheckoutAtOptions"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Options", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "destination_dfd", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Directory FD for destination", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "destination_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Directory for destination", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "commit", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Checksum for commit", 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 "Cancellable", 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_repo_checkout_at" ostree_repo_checkout_at :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr OSTree.RepoCheckoutAtOptions.RepoCheckoutAtOptions -> -- options : TInterface (Name {namespace = "OSTree", name = "RepoCheckoutAtOptions"})
    Int32 ->                                -- destination_dfd : TBasicType TInt
    CString ->                              -- destination_path : TBasicType TUTF8
    CString ->                              -- commit : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Similar to 'GI.OSTree.Objects.Repo.repoCheckoutTree', but uses directory-relative
paths for the destination, uses a new @OstreeRepoCheckoutAtOptions@,
and takes a commit checksum and optional subpath pair, rather than
requiring use of @GFile@ APIs for the caller.

It also replaces 'GI.OSTree.Objects.Repo.repoCheckoutAt' which was not safe to
use with GObject introspection.

Note in addition that unlike 'GI.OSTree.Objects.Repo.repoCheckoutTree', the
default is not to use the repository-internal uncompressed objects
cache.
-}
repoCheckoutAt ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (OSTree.RepoCheckoutAtOptions.RepoCheckoutAtOptions)
    {- ^ /@options@/: Options -}
    -> Int32
    {- ^ /@destinationDfd@/: Directory FD for destination -}
    -> T.Text
    {- ^ /@destinationPath@/: Directory for destination -}
    -> T.Text
    {- ^ /@commit@/: Checksum for commit -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoCheckoutAt self options destinationDfd destinationPath commit cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrGetPtr jOptions
            return jOptions'
    destinationPath' <- textToCString destinationPath
    commit' <- textToCString commit
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_checkout_at self' maybeOptions destinationDfd destinationPath' commit' maybeCancellable
        touchManagedPtr self
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem destinationPath'
        freeMem commit'
        return ()
     ) (do
        freeMem destinationPath'
        freeMem commit'
     )

data RepoCheckoutAtMethodInfo
instance (signature ~ (Maybe (OSTree.RepoCheckoutAtOptions.RepoCheckoutAtOptions) -> Int32 -> T.Text -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCheckoutAtMethodInfo a signature where
    overloadedMethod _ = repoCheckoutAt

-- method Repo::checkout_gc
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", 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 "Cancellable", 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_repo_checkout_gc" ostree_repo_checkout_gc :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Call this after finishing a succession of checkout operations; it
will delete any currently-unused uncompressed objects from the
cache.
-}
repoCheckoutGc ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoCheckoutGc self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_checkout_gc self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoCheckoutGcMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCheckoutGcMethodInfo a signature where
    overloadedMethod _ = repoCheckoutGc

-- method Repo::checkout_tree
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mode", argType = TInterface (Name {namespace = "OSTree", name = "RepoCheckoutMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Options controlling all files", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "overwrite_mode", argType = TInterface (Name {namespace = "OSTree", name = "RepoCheckoutOverwriteMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Whether or not to overwrite files", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "destination", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Place tree here", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "source", argType = TInterface (Name {namespace = "OSTree", name = "RepoFile"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Source tree", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "source_info", argType = TInterface (Name {namespace = "Gio", name = "FileInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Source info", 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 "Cancellable", 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_repo_checkout_tree" ostree_repo_checkout_tree :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- mode : TInterface (Name {namespace = "OSTree", name = "RepoCheckoutMode"})
    CUInt ->                                -- overwrite_mode : TInterface (Name {namespace = "OSTree", name = "RepoCheckoutOverwriteMode"})
    Ptr Gio.File.File ->                    -- destination : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr OSTree.RepoFile.RepoFile ->         -- source : TInterface (Name {namespace = "OSTree", name = "RepoFile"})
    Ptr Gio.FileInfo.FileInfo ->            -- source_info : TInterface (Name {namespace = "Gio", name = "FileInfo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Check out /@source@/ into /@destination@/, which must live on the
physical filesystem.  /@source@/ may be any subdirectory of a given
commit.  The /@mode@/ and /@overwriteMode@/ allow control over how the
files are checked out.
-}
repoCheckoutTree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.RepoFile.IsRepoFile c, Gio.FileInfo.IsFileInfo d, Gio.Cancellable.IsCancellable e) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.RepoCheckoutMode
    {- ^ /@mode@/: Options controlling all files -}
    -> OSTree.Enums.RepoCheckoutOverwriteMode
    {- ^ /@overwriteMode@/: Whether or not to overwrite files -}
    -> b
    {- ^ /@destination@/: Place tree here -}
    -> c
    {- ^ /@source@/: Source tree -}
    -> d
    {- ^ /@sourceInfo@/: Source info -}
    -> Maybe (e)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoCheckoutTree self mode overwriteMode destination source sourceInfo cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let mode' = (fromIntegral . fromEnum) mode
    let overwriteMode' = (fromIntegral . fromEnum) overwriteMode
    destination' <- unsafeManagedPtrCastPtr destination
    source' <- unsafeManagedPtrCastPtr source
    sourceInfo' <- unsafeManagedPtrCastPtr sourceInfo
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_checkout_tree self' mode' overwriteMode' destination' source' sourceInfo' maybeCancellable
        touchManagedPtr self
        touchManagedPtr destination
        touchManagedPtr source
        touchManagedPtr sourceInfo
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoCheckoutTreeMethodInfo
instance (signature ~ (OSTree.Enums.RepoCheckoutMode -> OSTree.Enums.RepoCheckoutOverwriteMode -> b -> c -> d -> Maybe (e) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.RepoFile.IsRepoFile c, Gio.FileInfo.IsFileInfo d, Gio.Cancellable.IsCancellable e) => O.MethodInfo RepoCheckoutTreeMethodInfo a signature where
    overloadedMethod _ = repoCheckoutTree

-- method Repo::commit_transaction
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_stats", argType = TInterface (Name {namespace = "OSTree", name = "RepoTransactionStats"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A set of statistics of things\nthat happened during this transaction.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Cancellable", 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_repo_commit_transaction" ostree_repo_commit_transaction :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr OSTree.RepoTransactionStats.RepoTransactionStats -> -- out_stats : TInterface (Name {namespace = "OSTree", name = "RepoTransactionStats"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Complete the transaction. Any refs set with
'GI.OSTree.Objects.Repo.repoTransactionSetRef' or
'GI.OSTree.Objects.Repo.repoTransactionSetRefspec' will be written out.
-}
repoCommitTransaction ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (OSTree.RepoTransactionStats.RepoTransactionStats)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoCommitTransaction self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    outStats <- callocBoxedBytes 56 :: IO (Ptr OSTree.RepoTransactionStats.RepoTransactionStats)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_commit_transaction self' outStats maybeCancellable
        outStats' <- (wrapBoxed OSTree.RepoTransactionStats.RepoTransactionStats) outStats
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return outStats'
     ) (do
        freeMem outStats
     )

data RepoCommitTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m (OSTree.RepoTransactionStats.RepoTransactionStats)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCommitTransactionMethodInfo a signature where
    overloadedMethod _ = repoCommitTransaction

-- method Repo::copy_config
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "KeyFile"}))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_copy_config" ostree_repo_copy_config :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    IO (Ptr GLib.KeyFile.KeyFile)

{- |
/No description available in the introspection data./
-}
repoCopyConfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -> m GLib.KeyFile.KeyFile
    {- ^ __Returns:__ A newly-allocated copy of the repository config -}
repoCopyConfig self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_repo_copy_config self'
    checkUnexpectedReturnNULL "repoCopyConfig" result
    result' <- (wrapBoxed GLib.KeyFile.KeyFile) result
    touchManagedPtr self
    return result'

data RepoCopyConfigMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsRepo a) => O.MethodInfo RepoCopyConfigMethodInfo a signature where
    overloadedMethod _ = repoCopyConfig

-- method Repo::create
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mode", argType = TInterface (Name {namespace = "OSTree", name = "RepoMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The mode to store the repository in", 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 "Cancellable", 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_repo_create" ostree_repo_create :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- mode : TInterface (Name {namespace = "OSTree", name = "RepoMode"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Create the underlying structure on disk for the repository, and call
'GI.OSTree.Objects.Repo.repoOpen' on the result, preparing it for use.

Since version 2016.8, this function will succeed on an existing
repository, and finish creating any necessary files in a partially
created repository.  However, this function cannot change the mode
of an existing repository, and will silently ignore an attempt to
do so.
-}
repoCreate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> OSTree.Enums.RepoMode
    {- ^ /@mode@/: The mode to store the repository in -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoCreate self mode cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let mode' = (fromIntegral . fromEnum) mode
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_create self' mode' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoCreateMethodInfo
instance (signature ~ (OSTree.Enums.RepoMode -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoCreateMethodInfo a signature where
    overloadedMethod _ = repoCreate

-- method Repo::delete_object
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sha256", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Checksum", 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 "Cancellable", 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_repo_delete_object" ostree_repo_delete_object :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- sha256 : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Remove the object of type /@objtype@/ with checksum /@sha256@/
from the repository.  An error of type 'GI.Gio.Enums.IOErrorEnumNotFound'
is thrown if the object does not exist.
-}
repoDeleteObject ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@sha256@/: Checksum -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoDeleteObject self objtype sha256 cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    sha256' <- textToCString sha256
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_delete_object self' objtype' sha256' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem sha256'
        return ()
     ) (do
        freeMem sha256'
     )

data RepoDeleteObjectMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoDeleteObjectMethodInfo a signature where
    overloadedMethod _ = repoDeleteObject

-- method Repo::get_config
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GLib", name = "KeyFile"}))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_get_config" ostree_repo_get_config :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    IO (Ptr GLib.KeyFile.KeyFile)

{- |
/No description available in the introspection data./
-}
repoGetConfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -> m GLib.KeyFile.KeyFile
    {- ^ __Returns:__ The repository configuration; do not modify -}
repoGetConfig self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_repo_get_config self'
    checkUnexpectedReturnNULL "repoGetConfig" result
    result' <- (newBoxed GLib.KeyFile.KeyFile) result
    touchManagedPtr self
    return result'

data RepoGetConfigMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsRepo a) => O.MethodInfo RepoGetConfigMethodInfo a signature where
    overloadedMethod _ = repoGetConfig

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

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

{- |
In some cases it\'s useful for applications to access the repository
directly; for example, writing content into @repo\/tmp@ ensures it\'s
on the same filesystem.  Another case is detecting the mtime on the
repository (to see whether a ref was written).
-}
repoGetDfd ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> m Int32
    {- ^ __Returns:__ File descriptor for repository root - owned by /@self@/ -}
repoGetDfd self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_repo_get_dfd self'
    touchManagedPtr self
    return result

data RepoGetDfdMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsRepo a) => O.MethodInfo RepoGetDfdMethodInfo a signature where
    overloadedMethod _ = repoGetDfd

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

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

{- |
For more information see 'GI.OSTree.Objects.Repo.repoSetDisableFsync'.
-}
repoGetDisableFsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> m Bool
    {- ^ __Returns:__ Whether or not @/fsync()/@ is enabled for this repo. -}
repoGetDisableFsync self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_repo_get_disable_fsync self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

data RepoGetDisableFsyncMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsRepo a) => O.MethodInfo RepoGetDisableFsyncMethodInfo a signature where
    overloadedMethod _ = repoGetDisableFsync

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

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

{- |
/No description available in the introspection data./
-}
repoGetMode ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -> m OSTree.Enums.RepoMode
repoGetMode self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_repo_get_mode self'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr self
    return result'

data RepoGetModeMethodInfo
instance (signature ~ (m OSTree.Enums.RepoMode), MonadIO m, IsRepo a) => O.MethodInfo RepoGetModeMethodInfo a signature where
    overloadedMethod _ = repoGetMode

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

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

{- |
Before this function can be used, @/ostree_repo_init()/@ must have been
called.
-}
repoGetParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> m Repo
    {- ^ __Returns:__ Parent repository, or 'Nothing' if none -}
repoGetParent self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_repo_get_parent self'
    checkUnexpectedReturnNULL "repoGetParent" result
    result' <- (newObject Repo) result
    touchManagedPtr self
    return result'

data RepoGetParentMethodInfo
instance (signature ~ (m Repo), MonadIO m, IsRepo a) => O.MethodInfo RepoGetParentMethodInfo a signature where
    overloadedMethod _ = repoGetParent

-- method Repo::get_path
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "File"}))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_get_path" ostree_repo_get_path :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    IO (Ptr Gio.File.File)

{- |
/No description available in the introspection data./
-}
repoGetPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -> m Gio.File.File
    {- ^ __Returns:__ Path to repo -}
repoGetPath self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- ostree_repo_get_path self'
    checkUnexpectedReturnNULL "repoGetPath" result
    result' <- (newObject Gio.File.File) result
    touchManagedPtr self
    return result'

data RepoGetPathMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsRepo a) => O.MethodInfo RepoGetPathMethodInfo a signature where
    overloadedMethod _ = repoGetPath

-- method Repo::get_remote_boolean_option
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "option_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Option", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_value", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Value returned if @option_name is not present", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_value", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "location to store the result.", 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_repo_get_remote_boolean_option" ostree_repo_get_remote_boolean_option :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    CString ->                              -- option_name : TBasicType TUTF8
    CInt ->                                 -- default_value : TBasicType TBoolean
    Ptr CInt ->                             -- out_value : TBasicType TBoolean
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
OSTree remotes are represented by keyfile groups, formatted like:
@[remote \"remotename\"]@. This function returns a value named /@optionName@/
underneath that group, and returns it as a boolean.
If the option is not set, /@outValue@/ will be set to /@defaultValue@/. If an
error is returned, /@outValue@/ will be set to 'False'.
-}
repoGetRemoteBooleanOption ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: A OstreeRepo -}
    -> T.Text
    {- ^ /@remoteName@/: Name -}
    -> T.Text
    {- ^ /@optionName@/: Option -}
    -> Bool
    {- ^ /@defaultValue@/: Value returned if /@optionName@/ is not present -}
    -> m (Bool)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoGetRemoteBooleanOption self remoteName optionName defaultValue = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteName' <- textToCString remoteName
    optionName' <- textToCString optionName
    let defaultValue' = (fromIntegral . fromEnum) defaultValue
    outValue <- allocMem :: IO (Ptr CInt)
    onException (do
        _ <- propagateGError $ ostree_repo_get_remote_boolean_option self' remoteName' optionName' defaultValue' outValue
        outValue' <- peek outValue
        let outValue'' = (/= 0) outValue'
        touchManagedPtr self
        freeMem remoteName'
        freeMem optionName'
        freeMem outValue
        return outValue''
     ) (do
        freeMem remoteName'
        freeMem optionName'
        freeMem outValue
     )

data RepoGetRemoteBooleanOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> Bool -> m (Bool)), MonadIO m, IsRepo a) => O.MethodInfo RepoGetRemoteBooleanOptionMethodInfo a signature where
    overloadedMethod _ = repoGetRemoteBooleanOption

-- method Repo::get_remote_list_option
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "option_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Option", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_value", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "location to store the list\n           of strings. The list should be freed with\n           g_strfreev().", 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_repo_get_remote_list_option" ostree_repo_get_remote_list_option :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    CString ->                              -- option_name : TBasicType TUTF8
    Ptr (Ptr CString) ->                    -- out_value : TCArray True (-1) (-1) (TBasicType TUTF8)
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
OSTree remotes are represented by keyfile groups, formatted like:
@[remote \"remotename\"]@. This function returns a value named /@optionName@/
underneath that group, and returns it as a zero terminated array of strings.
If the option is not set, or if an error is returned, /@outValue@/ will be set
to 'Nothing'.
-}
repoGetRemoteListOption ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: A OstreeRepo -}
    -> T.Text
    {- ^ /@remoteName@/: Name -}
    -> T.Text
    {- ^ /@optionName@/: Option -}
    -> m ([T.Text])
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoGetRemoteListOption self remoteName optionName = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteName' <- textToCString remoteName
    optionName' <- textToCString optionName
    outValue <- allocMem :: IO (Ptr (Ptr CString))
    onException (do
        _ <- propagateGError $ ostree_repo_get_remote_list_option self' remoteName' optionName' outValue
        outValue' <- peek outValue
        outValue'' <- unpackZeroTerminatedUTF8CArray outValue'
        mapZeroTerminatedCArray freeMem outValue'
        freeMem outValue'
        touchManagedPtr self
        freeMem remoteName'
        freeMem optionName'
        freeMem outValue
        return outValue''
     ) (do
        freeMem remoteName'
        freeMem optionName'
        freeMem outValue
     )

data RepoGetRemoteListOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ([T.Text])), MonadIO m, IsRepo a) => O.MethodInfo RepoGetRemoteListOptionMethodInfo a signature where
    overloadedMethod _ = repoGetRemoteListOption

-- method Repo::get_remote_option
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "option_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Option", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_value", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Value returned if @option_name is not present", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_value", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for value", 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_repo_get_remote_option" ostree_repo_get_remote_option :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    CString ->                              -- option_name : TBasicType TUTF8
    CString ->                              -- default_value : TBasicType TUTF8
    Ptr CString ->                          -- out_value : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
OSTree remotes are represented by keyfile groups, formatted like:
@[remote \"remotename\"]@. This function returns a value named /@optionName@/
underneath that group, or /@defaultValue@/ if the remote exists but not the
option name.  If an error is returned, /@outValue@/ will be set to 'Nothing'.
-}
repoGetRemoteOption ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: A OstreeRepo -}
    -> T.Text
    {- ^ /@remoteName@/: Name -}
    -> T.Text
    {- ^ /@optionName@/: Option -}
    -> Maybe (T.Text)
    {- ^ /@defaultValue@/: Value returned if /@optionName@/ is not present -}
    -> m (T.Text)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoGetRemoteOption self remoteName optionName defaultValue = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteName' <- textToCString remoteName
    optionName' <- textToCString optionName
    maybeDefaultValue <- case defaultValue of
        Nothing -> return nullPtr
        Just jDefaultValue -> do
            jDefaultValue' <- textToCString jDefaultValue
            return jDefaultValue'
    outValue <- allocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_get_remote_option self' remoteName' optionName' maybeDefaultValue outValue
        outValue' <- peek outValue
        outValue'' <- cstringToText outValue'
        freeMem outValue'
        touchManagedPtr self
        freeMem remoteName'
        freeMem optionName'
        freeMem maybeDefaultValue
        freeMem outValue
        return outValue''
     ) (do
        freeMem remoteName'
        freeMem optionName'
        freeMem maybeDefaultValue
        freeMem outValue
     )

data RepoGetRemoteOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (T.Text) -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoGetRemoteOptionMethodInfo a signature where
    overloadedMethod _ = repoGetRemoteOption

-- method Repo::gpg_verify_data
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repository", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Name of remote", 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 "Data as a #GBytes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "signatures", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Signatures as a #GBytes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "keyringdir", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Path to directory GPG keyrings; overrides built-in default if given", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "extra_keyring", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Path to additional keyring file (not a directory)", 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 "Cancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"}))
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_gpg_verify_data" ostree_repo_gpg_verify_data :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    Ptr GLib.Bytes.Bytes ->                 -- data : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr GLib.Bytes.Bytes ->                 -- signatures : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr Gio.File.File ->                    -- keyringdir : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.File.File ->                    -- extra_keyring : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr OSTree.GpgVerifyResult.GpgVerifyResult)

{- |
Verify /@signatures@/ for /@data@/ using GPG keys in the keyring for
/@remoteName@/, and return an 'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'.

The /@remoteName@/ parameter can be 'Nothing'. In that case it will do
the verifications using GPG keys in the keyrings of all remotes.
-}
repoGpgVerifyData ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) =>
    a
    {- ^ /@self@/: Repository -}
    -> Maybe (T.Text)
    {- ^ /@remoteName@/: Name of remote -}
    -> GLib.Bytes.Bytes
    {- ^ /@data@/: Data as a 'GI.GLib.Structs.Bytes.Bytes' -}
    -> GLib.Bytes.Bytes
    {- ^ /@signatures@/: Signatures as a 'GI.GLib.Structs.Bytes.Bytes' -}
    -> Maybe (b)
    {- ^ /@keyringdir@/: Path to directory GPG keyrings; overrides built-in default if given -}
    -> Maybe (c)
    {- ^ /@extraKeyring@/: Path to additional keyring file (not a directory) -}
    -> Maybe (d)
    {- ^ /@cancellable@/: Cancellable -}
    -> m OSTree.GpgVerifyResult.GpgVerifyResult
    {- ^ __Returns:__ an 'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoGpgVerifyData self remoteName data_ signatures keyringdir extraKeyring cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeRemoteName <- case remoteName of
        Nothing -> return nullPtr
        Just jRemoteName -> do
            jRemoteName' <- textToCString jRemoteName
            return jRemoteName'
    data_' <- unsafeManagedPtrGetPtr data_
    signatures' <- unsafeManagedPtrGetPtr signatures
    maybeKeyringdir <- case keyringdir of
        Nothing -> return nullPtr
        Just jKeyringdir -> do
            jKeyringdir' <- unsafeManagedPtrCastPtr jKeyringdir
            return jKeyringdir'
    maybeExtraKeyring <- case extraKeyring of
        Nothing -> return nullPtr
        Just jExtraKeyring -> do
            jExtraKeyring' <- unsafeManagedPtrCastPtr jExtraKeyring
            return jExtraKeyring'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_gpg_verify_data self' maybeRemoteName data_' signatures' maybeKeyringdir maybeExtraKeyring maybeCancellable
        checkUnexpectedReturnNULL "repoGpgVerifyData" result
        result' <- (wrapObject OSTree.GpgVerifyResult.GpgVerifyResult) result
        touchManagedPtr self
        touchManagedPtr data_
        touchManagedPtr signatures
        whenJust keyringdir touchManagedPtr
        whenJust extraKeyring touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem maybeRemoteName
        return result'
     ) (do
        freeMem maybeRemoteName
     )

data RepoGpgVerifyDataMethodInfo
instance (signature ~ (Maybe (T.Text) -> GLib.Bytes.Bytes -> GLib.Bytes.Bytes -> Maybe (b) -> Maybe (c) -> Maybe (d) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoGpgVerifyDataMethodInfo a signature where
    overloadedMethod _ = repoGpgVerifyData

-- method Repo::has_object
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_have_object", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if repository contains object", 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 "Cancellable", 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_repo_has_object" ostree_repo_has_object :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr CInt ->                             -- out_have_object : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Set /@outHaveObject@/ to 'True' if /@self@/ contains the given object;
'False' otherwise.
-}
repoHasObject ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@checksum@/: ASCII SHA256 checksum -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Bool)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoHasObject self objtype checksum cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    checksum' <- textToCString checksum
    outHaveObject <- allocMem :: IO (Ptr CInt)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_has_object self' objtype' checksum' outHaveObject maybeCancellable
        outHaveObject' <- peek outHaveObject
        let outHaveObject'' = (/= 0) outHaveObject'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        freeMem outHaveObject
        return outHaveObject''
     ) (do
        freeMem checksum'
        freeMem outHaveObject
     )

data RepoHasObjectMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m (Bool)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoHasObjectMethodInfo a signature where
    overloadedMethod _ = repoHasObject

-- method Repo::import_object_from
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Destination repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "source", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Source repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "checksum", 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 "Cancellable", 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_repo_import_object_from" ostree_repo_import_object_from :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Repo ->                             -- source : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Copy object named by /@objtype@/ and /@checksum@/ into /@self@/ from the
source repository /@source@/.  If both repositories are of the same
type and on the same filesystem, this will simply be a fast Unix
hard link operation.

Otherwise, a copy will be performed.
-}
repoImportObjectFrom ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Destination repo -}
    -> b
    {- ^ /@source@/: Source repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@checksum@/: checksum -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoImportObjectFrom self source objtype checksum cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    source' <- unsafeManagedPtrCastPtr source
    let objtype' = (fromIntegral . fromEnum) objtype
    checksum' <- textToCString checksum
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_import_object_from self' source' objtype' checksum' maybeCancellable
        touchManagedPtr self
        touchManagedPtr source
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

data RepoImportObjectFromMethodInfo
instance (signature ~ (b -> OSTree.Enums.ObjectType -> T.Text -> Maybe (c) -> m ()), MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoImportObjectFromMethodInfo a signature where
    overloadedMethod _ = repoImportObjectFrom

-- method Repo::import_object_from_with_trust
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Destination repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "source", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Source repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "trusted", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "If %TRUE, assume the source repo is valid and trusted", 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 "Cancellable", 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_repo_import_object_from_with_trust" ostree_repo_import_object_from_with_trust :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Repo ->                             -- source : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- checksum : TBasicType TUTF8
    CInt ->                                 -- trusted : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Copy object named by /@objtype@/ and /@checksum@/ into /@self@/ from the
source repository /@source@/.  If both repositories are of the same
type and on the same filesystem, this will simply be a fast Unix
hard link operation.

Otherwise, a copy will be performed.
-}
repoImportObjectFromWithTrust ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Destination repo -}
    -> b
    {- ^ /@source@/: Source repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@checksum@/: checksum -}
    -> Bool
    {- ^ /@trusted@/: If 'True', assume the source repo is valid and trusted -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoImportObjectFromWithTrust self source objtype checksum trusted cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    source' <- unsafeManagedPtrCastPtr source
    let objtype' = (fromIntegral . fromEnum) objtype
    checksum' <- textToCString checksum
    let trusted' = (fromIntegral . fromEnum) trusted
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_import_object_from_with_trust self' source' objtype' checksum' trusted' maybeCancellable
        touchManagedPtr self
        touchManagedPtr source
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

data RepoImportObjectFromWithTrustMethodInfo
instance (signature ~ (b -> OSTree.Enums.ObjectType -> T.Text -> Bool -> Maybe (c) -> m ()), MonadIO m, IsRepo a, IsRepo b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoImportObjectFromWithTrustMethodInfo a signature where
    overloadedMethod _ = repoImportObjectFromWithTrust

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

foreign import ccall "ostree_repo_is_system" ostree_repo_is_system :: 
    Ptr Repo ->                             -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    IO CInt

{- |
/No description available in the introspection data./
-}
repoIsSystem ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@repo@/: Repository -}
    -> m Bool
    {- ^ __Returns:__ 'True' if this repository is the root-owned system global repository -}
repoIsSystem repo = liftIO $ do
    repo' <- unsafeManagedPtrCastPtr repo
    result <- ostree_repo_is_system repo'
    let result' = (/= 0) result
    touchManagedPtr repo
    return result'

data RepoIsSystemMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsRepo a) => O.MethodInfo RepoIsSystemMethodInfo a signature where
    overloadedMethod _ = repoIsSystem

-- method Repo::is_writable
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", 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_repo_is_writable" ostree_repo_is_writable :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Returns whether the repository is writable by the current user.
If the repository is not writable, the /@error@/ indicates why.
-}
repoIsWritable ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoIsWritable self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    onException (do
        _ <- propagateGError $ ostree_repo_is_writable self'
        touchManagedPtr self
        return ()
     ) (do
        return ()
     )

data RepoIsWritableMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoIsWritableMethodInfo a signature where
    overloadedMethod _ = repoIsWritable

-- XXX Could not generate method Repo::list_commit_objects_starting_with
-- Error was : Not implemented: "GHashTable element of type TVariant unsupported."
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoListCommitObjectsStartingWithMethodInfo
instance (p ~ (), o ~ O.MethodResolutionFailed "listCommitObjectsStartingWith" Repo) => O.MethodInfo RepoListCommitObjectsStartingWithMethodInfo o p where
    overloadedMethod _ = undefined
-- XXX Could not generate method Repo::list_objects
-- Error was : Not implemented: "GHashTable element of type TVariant unsupported."
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoListObjectsMethodInfo
instance (p ~ (), o ~ O.MethodResolutionFailed "listObjects" Repo) => O.MethodInfo RepoListObjectsMethodInfo o p where
    overloadedMethod _ = undefined
-- method Repo::list_refs
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "refspec_prefix", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Only list refs which match this prefix", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_all_refs", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Mapping from ref to checksum", 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 "Cancellable", 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_repo_list_refs" ostree_repo_list_refs :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- refspec_prefix : TBasicType TUTF8
    Ptr (Ptr (GHashTable CString CString)) -> -- out_all_refs : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
If /@refspecPrefix@/ is 'Nothing', list all local and remote refspecs,
with their current values in /@outAllRefs@/.  Otherwise, only list
refspecs which have /@refspecPrefix@/ as a prefix.
-}
repoListRefs ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (T.Text)
    {- ^ /@refspecPrefix@/: Only list refs which match this prefix -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ((Map.Map T.Text T.Text))
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoListRefs self refspecPrefix cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeRefspecPrefix <- case refspecPrefix of
        Nothing -> return nullPtr
        Just jRefspecPrefix -> do
            jRefspecPrefix' <- textToCString jRefspecPrefix
            return jRefspecPrefix'
    outAllRefs <- allocMem :: IO (Ptr (Ptr (GHashTable CString CString)))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_list_refs self' maybeRefspecPrefix outAllRefs maybeCancellable
        outAllRefs' <- peek outAllRefs
        outAllRefs'' <- unpackGHashTable outAllRefs'
        let outAllRefs''' = mapFirst cstringUnpackPtr outAllRefs''
        outAllRefs'''' <- mapFirstA cstringToText outAllRefs'''
        let outAllRefs''''' = mapSecond cstringUnpackPtr outAllRefs''''
        outAllRefs'''''' <- mapSecondA cstringToText outAllRefs'''''
        let outAllRefs''''''' = Map.fromList outAllRefs''''''
        unrefGHashTable outAllRefs'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem maybeRefspecPrefix
        freeMem outAllRefs
        return outAllRefs'''''''
     ) (do
        freeMem maybeRefspecPrefix
        freeMem outAllRefs
     )

data RepoListRefsMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (b) -> m ((Map.Map T.Text T.Text))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoListRefsMethodInfo a signature where
    overloadedMethod _ = repoListRefs

-- method Repo::list_refs_ext
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "refspec_prefix", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Only list refs which match this prefix", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_all_refs", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Mapping from ref to checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "flags", argType = TInterface (Name {namespace = "OSTree", name = "RepoListRefsExtFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Options controlling listing behavior", 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 "Cancellable", 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_repo_list_refs_ext" ostree_repo_list_refs_ext :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- refspec_prefix : TBasicType TUTF8
    Ptr (Ptr (GHashTable CString CString)) -> -- out_all_refs : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoListRefsExtFlags"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
If /@refspecPrefix@/ is 'Nothing', list all local and remote refspecs,
with their current values in /@outAllRefs@/.  Otherwise, only list
refspecs which have /@refspecPrefix@/ as a prefix.  Differently from
'GI.OSTree.Objects.Repo.repoListRefs', the prefix will not be removed from the ref
name.
-}
repoListRefsExt ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (T.Text)
    {- ^ /@refspecPrefix@/: Only list refs which match this prefix -}
    -> OSTree.Enums.RepoListRefsExtFlags
    {- ^ /@flags@/: Options controlling listing behavior -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ((Map.Map T.Text T.Text))
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoListRefsExt self refspecPrefix flags cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeRefspecPrefix <- case refspecPrefix of
        Nothing -> return nullPtr
        Just jRefspecPrefix -> do
            jRefspecPrefix' <- textToCString jRefspecPrefix
            return jRefspecPrefix'
    outAllRefs <- allocMem :: IO (Ptr (Ptr (GHashTable CString CString)))
    let flags' = (fromIntegral . fromEnum) flags
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_list_refs_ext self' maybeRefspecPrefix outAllRefs flags' maybeCancellable
        outAllRefs' <- peek outAllRefs
        outAllRefs'' <- unpackGHashTable outAllRefs'
        let outAllRefs''' = mapFirst cstringUnpackPtr outAllRefs''
        outAllRefs'''' <- mapFirstA cstringToText outAllRefs'''
        let outAllRefs''''' = mapSecond cstringUnpackPtr outAllRefs''''
        outAllRefs'''''' <- mapSecondA cstringToText outAllRefs'''''
        let outAllRefs''''''' = Map.fromList outAllRefs''''''
        unrefGHashTable outAllRefs'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem maybeRefspecPrefix
        freeMem outAllRefs
        return outAllRefs'''''''
     ) (do
        freeMem maybeRefspecPrefix
        freeMem outAllRefs
     )

data RepoListRefsExtMethodInfo
instance (signature ~ (Maybe (T.Text) -> OSTree.Enums.RepoListRefsExtFlags -> Maybe (b) -> m ((Map.Map T.Text T.Text))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoListRefsExtMethodInfo a signature where
    overloadedMethod _ = repoListRefsExt

-- method Repo::list_static_delta_names
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_deltas", argType = TPtrArray (TBasicType TUTF8), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "String name of deltas (checksum-checksum.delta)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferContainer},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Cancellable", 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_repo_list_static_delta_names" ostree_repo_list_static_delta_names :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr (Ptr (GPtrArray CString)) ->        -- out_deltas : TPtrArray (TBasicType TUTF8)
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
This function synchronously enumerates all static deltas in the
repository, returning its result in /@outDeltas@/.
-}
repoListStaticDeltaNames ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ([T.Text])
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoListStaticDeltaNames self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    outDeltas <- allocMem :: IO (Ptr (Ptr (GPtrArray CString)))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_list_static_delta_names self' outDeltas maybeCancellable
        outDeltas' <- peek outDeltas
        outDeltas'' <- unpackGPtrArray outDeltas'
        outDeltas''' <- mapM cstringToText outDeltas''
        unrefPtrArray outDeltas'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem outDeltas
        return outDeltas'''
     ) (do
        freeMem outDeltas
     )

data RepoListStaticDeltaNamesMethodInfo
instance (signature ~ (Maybe (b) -> m ([T.Text])), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoListStaticDeltaNamesMethodInfo a signature where
    overloadedMethod _ = repoListStaticDeltaNames

-- method Repo::load_commit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Commit checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_commit", argType = TVariant, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Commit", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_state", argType = TInterface (Name {namespace = "OSTree", name = "RepoCommitState"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Commit state", 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_repo_load_commit" ostree_repo_load_commit :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr (Ptr GVariant) ->                   -- out_commit : TVariant
    Ptr CUInt ->                            -- out_state : TInterface (Name {namespace = "OSTree", name = "RepoCommitState"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
A version of 'GI.OSTree.Objects.Repo.repoLoadVariant' specialized to commits,
capable of returning extended state information.  Currently
the only extended state is 'GI.OSTree.Flags.RepoCommitStateRepoCommitStatePartial', which
means that only a sub-path of the commit is available.
-}
repoLoadCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@checksum@/: Commit checksum -}
    -> m (GVariant,[OSTree.Flags.RepoCommitState])
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoLoadCommit self checksum = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    checksum' <- textToCString checksum
    outCommit <- allocMem :: IO (Ptr (Ptr GVariant))
    outState <- allocMem :: IO (Ptr CUInt)
    onException (do
        _ <- propagateGError $ ostree_repo_load_commit self' checksum' outCommit outState
        outCommit' <- peek outCommit
        outCommit'' <- wrapGVariantPtr outCommit'
        outState' <- peek outState
        let outState'' = wordToGFlags outState'
        touchManagedPtr self
        freeMem checksum'
        freeMem outCommit
        freeMem outState
        return (outCommit'', outState'')
     ) (do
        freeMem checksum'
        freeMem outCommit
        freeMem outState
     )

data RepoLoadCommitMethodInfo
instance (signature ~ (T.Text -> m (GVariant,[OSTree.Flags.RepoCommitState])), MonadIO m, IsRepo a) => O.MethodInfo RepoLoadCommitMethodInfo a signature where
    overloadedMethod _ = repoLoadCommit

-- method Repo::load_file
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_input", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "File content", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_file_info", argType = TInterface (Name {namespace = "Gio", name = "FileInfo"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "File information", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_xattrs", argType = TVariant, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Extended attributes", 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 "Cancellable", 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_repo_load_file" ostree_repo_load_file :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Ptr (Ptr Gio.FileInfo.FileInfo) ->      -- out_file_info : TInterface (Name {namespace = "Gio", name = "FileInfo"})
    Ptr (Ptr GVariant) ->                   -- out_xattrs : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Load content object, decomposing it into three parts: the actual
content (for regular files), the metadata, and extended attributes.
-}
repoLoadFile ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@checksum@/: ASCII SHA256 checksum -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Gio.InputStream.InputStream,Gio.FileInfo.FileInfo,GVariant)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoLoadFile self checksum cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    checksum' <- textToCString checksum
    outInput <- allocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream))
    outFileInfo <- allocMem :: IO (Ptr (Ptr Gio.FileInfo.FileInfo))
    outXattrs <- allocMem :: IO (Ptr (Ptr GVariant))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_load_file self' checksum' outInput outFileInfo outXattrs maybeCancellable
        outInput' <- peek outInput
        outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput'
        outFileInfo' <- peek outFileInfo
        outFileInfo'' <- (wrapObject Gio.FileInfo.FileInfo) outFileInfo'
        outXattrs' <- peek outXattrs
        outXattrs'' <- wrapGVariantPtr outXattrs'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        freeMem outInput
        freeMem outFileInfo
        freeMem outXattrs
        return (outInput'', outFileInfo'', outXattrs'')
     ) (do
        freeMem checksum'
        freeMem outInput
        freeMem outFileInfo
        freeMem outXattrs
     )

data RepoLoadFileMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m (Gio.InputStream.InputStream,Gio.FileInfo.FileInfo,GVariant)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoLoadFileMethodInfo a signature where
    overloadedMethod _ = repoLoadFile

-- method Repo::load_object_stream
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_input", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Stream for object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_size", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Length of @out_input", 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 "Cancellable", 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_repo_load_object_stream" ostree_repo_load_object_stream :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr (Ptr Gio.InputStream.InputStream) -> -- out_input : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Ptr Word64 ->                           -- out_size : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Load object as a stream; useful when copying objects between
repositories.
-}
repoLoadObjectStream ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@checksum@/: ASCII SHA256 checksum -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Gio.InputStream.InputStream,Word64)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoLoadObjectStream self objtype checksum cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    checksum' <- textToCString checksum
    outInput <- allocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream))
    outSize <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_load_object_stream self' objtype' checksum' outInput outSize maybeCancellable
        outInput' <- peek outInput
        outInput'' <- (wrapObject Gio.InputStream.InputStream) outInput'
        outSize' <- peek outSize
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        freeMem outInput
        freeMem outSize
        return (outInput'', outSize')
     ) (do
        freeMem checksum'
        freeMem outInput
        freeMem outSize
     )

data RepoLoadObjectStreamMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m (Gio.InputStream.InputStream,Word64)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoLoadObjectStreamMethodInfo a signature where
    overloadedMethod _ = repoLoadObjectStream

-- method Repo::load_variant
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Expected object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sha256", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Checksum string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_variant", argType = TVariant, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Metadata object", 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_repo_load_variant" ostree_repo_load_variant :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- sha256 : TBasicType TUTF8
    Ptr (Ptr GVariant) ->                   -- out_variant : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Load the metadata object /@sha256@/ of type /@objtype@/, storing the
result in /@outVariant@/.
-}
repoLoadVariant ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Expected object type -}
    -> T.Text
    {- ^ /@sha256@/: Checksum string -}
    -> m (GVariant)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoLoadVariant self objtype sha256 = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    sha256' <- textToCString sha256
    outVariant <- allocMem :: IO (Ptr (Ptr GVariant))
    onException (do
        _ <- propagateGError $ ostree_repo_load_variant self' objtype' sha256' outVariant
        outVariant' <- peek outVariant
        outVariant'' <- wrapGVariantPtr outVariant'
        touchManagedPtr self
        freeMem sha256'
        freeMem outVariant
        return outVariant''
     ) (do
        freeMem sha256'
        freeMem outVariant
     )

data RepoLoadVariantMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> m (GVariant)), MonadIO m, IsRepo a) => O.MethodInfo RepoLoadVariantMethodInfo a signature where
    overloadedMethod _ = repoLoadVariant

-- method Repo::load_variant_if_exists
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sha256", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_variant", argType = TVariant, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Metadata", 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_repo_load_variant_if_exists" ostree_repo_load_variant_if_exists :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- sha256 : TBasicType TUTF8
    Ptr (Ptr GVariant) ->                   -- out_variant : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Attempt to load the metadata object /@sha256@/ of type /@objtype@/ if it
exists, storing the result in /@outVariant@/.  If it doesn\'t exist,
'Nothing' is returned.
-}
repoLoadVariantIfExists ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@sha256@/: ASCII checksum -}
    -> m (GVariant)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoLoadVariantIfExists self objtype sha256 = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    sha256' <- textToCString sha256
    outVariant <- allocMem :: IO (Ptr (Ptr GVariant))
    onException (do
        _ <- propagateGError $ ostree_repo_load_variant_if_exists self' objtype' sha256' outVariant
        outVariant' <- peek outVariant
        outVariant'' <- wrapGVariantPtr outVariant'
        touchManagedPtr self
        freeMem sha256'
        freeMem outVariant
        return outVariant''
     ) (do
        freeMem sha256'
        freeMem outVariant
     )

data RepoLoadVariantIfExistsMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> m (GVariant)), MonadIO m, IsRepo a) => O.MethodInfo RepoLoadVariantIfExistsMethodInfo a signature where
    overloadedMethod _ = repoLoadVariantIfExists

-- method Repo::open
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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 = Nothing, 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_repo_open" ostree_repo_open :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
/No description available in the introspection data./
-}
repoOpen ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -> Maybe (b)
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoOpen self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_open self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoOpenMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoOpenMethodInfo a signature where
    overloadedMethod _ = repoOpen

-- method Repo::prepare_transaction
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_transaction_resume", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Whether this transaction\nis resuming from a previous one.  This is a legacy state, now OSTree\npulls use per-commit `state/.commitpartial` files.", 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 "Cancellable", 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_repo_prepare_transaction" ostree_repo_prepare_transaction :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr CInt ->                             -- out_transaction_resume : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Starts or resumes a transaction. In order to write to a repo, you
need to start a transaction. You can complete the transaction with
'GI.OSTree.Objects.Repo.repoCommitTransaction', or abort the transaction with
'GI.OSTree.Objects.Repo.repoAbortTransaction'.

Currently, transactions are not atomic, and aborting a transaction
will not erase any data you  write during the transaction.
-}
repoPrepareTransaction ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Bool)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoPrepareTransaction self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    outTransactionResume <- allocMem :: IO (Ptr CInt)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_prepare_transaction self' outTransactionResume maybeCancellable
        outTransactionResume' <- peek outTransactionResume
        let outTransactionResume'' = (/= 0) outTransactionResume'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem outTransactionResume
        return outTransactionResume''
     ) (do
        freeMem outTransactionResume
     )

data RepoPrepareTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m (Bool)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPrepareTransactionMethodInfo a signature where
    overloadedMethod _ = repoPrepareTransaction

-- method Repo::prune
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "OSTree", name = "RepoPruneFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Options controlling prune process", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "depth", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Stop traversal after this many iterations (-1 for unlimited)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_objects_total", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of objects found", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_objects_pruned", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of objects deleted", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_pruned_object_size_total", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Storage size in bytes of objects deleted", 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 "Cancellable", 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_repo_prune" ostree_repo_prune :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoPruneFlags"})
    Int32 ->                                -- depth : TBasicType TInt
    Ptr Int32 ->                            -- out_objects_total : TBasicType TInt
    Ptr Int32 ->                            -- out_objects_pruned : TBasicType TInt
    Ptr Word64 ->                           -- out_pruned_object_size_total : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Delete content from the repository.  By default, this function will
only delete \"orphaned\" objects not referred to by any commit.  This
can happen during a local commit operation, when we have written
content objects but not saved the commit referencing them.

However, if 'GI.OSTree.Enums.RepoPruneFlagsRefsOnly' is provided, instead
of traversing all commits, only refs will be used.  Particularly
when combined with /@depth@/, this is a convenient way to delete
history from the repository.

Use the 'GI.OSTree.Enums.RepoPruneFlagsNoPrune' to just determine
statistics on objects that would be deleted, without actually
deleting them.
-}
repoPrune ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.RepoPruneFlags
    {- ^ /@flags@/: Options controlling prune process -}
    -> Int32
    {- ^ /@depth@/: Stop traversal after this many iterations (-1 for unlimited) -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Int32,Int32,Word64)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoPrune self flags depth cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let flags' = (fromIntegral . fromEnum) flags
    outObjectsTotal <- allocMem :: IO (Ptr Int32)
    outObjectsPruned <- allocMem :: IO (Ptr Int32)
    outPrunedObjectSizeTotal <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_prune self' flags' depth outObjectsTotal outObjectsPruned outPrunedObjectSizeTotal maybeCancellable
        outObjectsTotal' <- peek outObjectsTotal
        outObjectsPruned' <- peek outObjectsPruned
        outPrunedObjectSizeTotal' <- peek outPrunedObjectSizeTotal
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem outObjectsTotal
        freeMem outObjectsPruned
        freeMem outPrunedObjectSizeTotal
        return (outObjectsTotal', outObjectsPruned', outPrunedObjectSizeTotal')
     ) (do
        freeMem outObjectsTotal
        freeMem outObjectsPruned
        freeMem outPrunedObjectSizeTotal
     )

data RepoPruneMethodInfo
instance (signature ~ (OSTree.Enums.RepoPruneFlags -> Int32 -> Maybe (b) -> m (Int32,Int32,Word64)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPruneMethodInfo a signature where
    overloadedMethod _ = repoPrune

-- method Repo::prune_from_reachable
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TInterface (Name {namespace = "OSTree", name = "RepoPruneOptions"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Options controlling prune process", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_objects_total", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of objects found", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_objects_pruned", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of objects deleted", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_pruned_object_size_total", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Storage size in bytes of objects deleted", 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 "Cancellable", 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_repo_prune_from_reachable" ostree_repo_prune_from_reachable :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr OSTree.RepoPruneOptions.RepoPruneOptions -> -- options : TInterface (Name {namespace = "OSTree", name = "RepoPruneOptions"})
    Ptr Int32 ->                            -- out_objects_total : TBasicType TInt
    Ptr Int32 ->                            -- out_objects_pruned : TBasicType TInt
    Ptr Word64 ->                           -- out_pruned_object_size_total : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Delete content from the repository.  This function is the \"backend\"
half of the higher level 'GI.OSTree.Objects.Repo.repoPrune'.  To use this function,
you determine the root set yourself, and this function finds all other
unreferenced objects and deletes them.

Use this API when you want to perform more selective pruning - for example,
retain all commits from a production branch, but just GC some history from
your dev branch.

The 'GI.OSTree.Enums.RepoPruneFlagsNoPrune' flag may be specified to just determine
statistics on objects that would be deleted, without actually deleting them.
-}
repoPruneFromReachable ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.RepoPruneOptions.RepoPruneOptions
    {- ^ /@options@/: Options controlling prune process -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Int32,Int32,Word64)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoPruneFromReachable self options cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    options' <- unsafeManagedPtrGetPtr options
    outObjectsTotal <- allocMem :: IO (Ptr Int32)
    outObjectsPruned <- allocMem :: IO (Ptr Int32)
    outPrunedObjectSizeTotal <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_prune_from_reachable self' options' outObjectsTotal outObjectsPruned outPrunedObjectSizeTotal maybeCancellable
        outObjectsTotal' <- peek outObjectsTotal
        outObjectsPruned' <- peek outObjectsPruned
        outPrunedObjectSizeTotal' <- peek outPrunedObjectSizeTotal
        touchManagedPtr self
        touchManagedPtr options
        whenJust cancellable touchManagedPtr
        freeMem outObjectsTotal
        freeMem outObjectsPruned
        freeMem outPrunedObjectSizeTotal
        return (outObjectsTotal', outObjectsPruned', outPrunedObjectSizeTotal')
     ) (do
        freeMem outObjectsTotal
        freeMem outObjectsPruned
        freeMem outPrunedObjectSizeTotal
     )

data RepoPruneFromReachableMethodInfo
instance (signature ~ (OSTree.RepoPruneOptions.RepoPruneOptions -> Maybe (b) -> m (Int32,Int32,Word64)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPruneFromReachableMethodInfo a signature where
    overloadedMethod _ = repoPruneFromReachable

-- method Repo::prune_static_deltas
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "commit", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum for commit, or %NULL for each\nnon existing commit", 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 "Cancellable", 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_repo_prune_static_deltas" ostree_repo_prune_static_deltas :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Prune static deltas, if COMMIT is specified then delete static delta files only
targeting that commit; otherwise any static delta of non existing commits are
deleted.
-}
repoPruneStaticDeltas ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (T.Text)
    {- ^ /@commit@/: ASCII SHA256 checksum for commit, or 'Nothing' for each
non existing commit -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoPruneStaticDeltas self commit cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCommit <- case commit of
        Nothing -> return nullPtr
        Just jCommit -> do
            jCommit' <- textToCString jCommit
            return jCommit'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_prune_static_deltas self' maybeCommit maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem maybeCommit
        return ()
     ) (do
        freeMem maybeCommit
     )

data RepoPruneStaticDeltasMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoPruneStaticDeltasMethodInfo a signature where
    overloadedMethod _ = repoPruneStaticDeltas

-- method Repo::pull
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "refs_to_fetch", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Optional list of refs; if %NULL, fetch all configured refs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "OSTree", name = "RepoPullFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Options controlling fetch behavior", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "progress", argType = TInterface (Name {namespace = "OSTree", name = "AsyncProgress"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Progress", 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 "Cancellable", 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_repo_pull" ostree_repo_pull :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    Ptr CString ->                          -- refs_to_fetch : TCArray True (-1) (-1) (TBasicType TUTF8)
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoPullFlags"})
    Ptr OSTree.AsyncProgress.AsyncProgress -> -- progress : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Connect to the remote repository, fetching the specified set of
refs /@refsToFetch@/.  For each ref that is changed, download the
commit, all metadata, and all content objects, storing them safely
on disk in /@self@/.

If /@flags@/ contains 'GI.OSTree.Flags.RepoPullFlagsMirror', and
the /@refsToFetch@/ is 'Nothing', and the remote repository contains a
summary file, then all refs will be fetched.

If /@flags@/ contains 'GI.OSTree.Flags.RepoPullFlagsCommitOnly', then only the
metadata for the commits in /@refsToFetch@/ is pulled.

Warning: This API will iterate the thread default main context,
which is a bug, but kept for compatibility reasons.  If you want to
avoid this, use 'GI.GLib.Structs.MainContext.mainContextPushThreadDefault' to push a new
one around this call.
-}
repoPull ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@remoteName@/: Name of remote -}
    -> Maybe ([T.Text])
    {- ^ /@refsToFetch@/: Optional list of refs; if 'Nothing', fetch all configured refs -}
    -> [OSTree.Flags.RepoPullFlags]
    {- ^ /@flags@/: Options controlling fetch behavior -}
    -> Maybe (b)
    {- ^ /@progress@/: Progress -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoPull self remoteName refsToFetch flags progress cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteName' <- textToCString remoteName
    maybeRefsToFetch <- case refsToFetch of
        Nothing -> return nullPtr
        Just jRefsToFetch -> do
            jRefsToFetch' <- packZeroTerminatedUTF8CArray jRefsToFetch
            return jRefsToFetch'
    let flags' = gflagsToWord flags
    maybeProgress <- case progress of
        Nothing -> return nullPtr
        Just jProgress -> do
            jProgress' <- unsafeManagedPtrCastPtr jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_pull self' remoteName' maybeRefsToFetch flags' maybeProgress maybeCancellable
        touchManagedPtr self
        whenJust progress touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem remoteName'
        mapZeroTerminatedCArray freeMem maybeRefsToFetch
        freeMem maybeRefsToFetch
        return ()
     ) (do
        freeMem remoteName'
        mapZeroTerminatedCArray freeMem maybeRefsToFetch
        freeMem maybeRefsToFetch
     )

data RepoPullMethodInfo
instance (signature ~ (T.Text -> Maybe ([T.Text]) -> [OSTree.Flags.RepoPullFlags] -> Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoPullMethodInfo a signature where
    overloadedMethod _ = repoPull

-- method Repo::pull_one_dir
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dir_to_pull", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Subdirectory path", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "refs_to_fetch", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Optional list of refs; if %NULL, fetch all configured refs", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "OSTree", name = "RepoPullFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Options controlling fetch behavior", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "progress", argType = TInterface (Name {namespace = "OSTree", name = "AsyncProgress"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Progress", 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 "Cancellable", 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_repo_pull_one_dir" ostree_repo_pull_one_dir :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    CString ->                              -- dir_to_pull : TBasicType TUTF8
    Ptr CString ->                          -- refs_to_fetch : TCArray True (-1) (-1) (TBasicType TUTF8)
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoPullFlags"})
    Ptr OSTree.AsyncProgress.AsyncProgress -> -- progress : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
This is similar to 'GI.OSTree.Objects.Repo.repoPull', but only fetches a single
subpath.
-}
repoPullOneDir ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@remoteName@/: Name of remote -}
    -> T.Text
    {- ^ /@dirToPull@/: Subdirectory path -}
    -> Maybe ([T.Text])
    {- ^ /@refsToFetch@/: Optional list of refs; if 'Nothing', fetch all configured refs -}
    -> [OSTree.Flags.RepoPullFlags]
    {- ^ /@flags@/: Options controlling fetch behavior -}
    -> Maybe (b)
    {- ^ /@progress@/: Progress -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoPullOneDir self remoteName dirToPull refsToFetch flags progress cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteName' <- textToCString remoteName
    dirToPull' <- textToCString dirToPull
    maybeRefsToFetch <- case refsToFetch of
        Nothing -> return nullPtr
        Just jRefsToFetch -> do
            jRefsToFetch' <- packZeroTerminatedUTF8CArray jRefsToFetch
            return jRefsToFetch'
    let flags' = gflagsToWord flags
    maybeProgress <- case progress of
        Nothing -> return nullPtr
        Just jProgress -> do
            jProgress' <- unsafeManagedPtrCastPtr jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_pull_one_dir self' remoteName' dirToPull' maybeRefsToFetch flags' maybeProgress maybeCancellable
        touchManagedPtr self
        whenJust progress touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem remoteName'
        freeMem dirToPull'
        mapZeroTerminatedCArray freeMem maybeRefsToFetch
        freeMem maybeRefsToFetch
        return ()
     ) (do
        freeMem remoteName'
        freeMem dirToPull'
        mapZeroTerminatedCArray freeMem maybeRefsToFetch
        freeMem maybeRefsToFetch
     )

data RepoPullOneDirMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe ([T.Text]) -> [OSTree.Flags.RepoPullFlags] -> Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoPullOneDirMethodInfo a signature where
    overloadedMethod _ = repoPullOneDir

-- method Repo::pull_with_options
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name_or_baseurl", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote or file:// url", 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 "A GVariant a{sv} with an extensible set of flags.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "progress", argType = TInterface (Name {namespace = "OSTree", name = "AsyncProgress"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Progress", 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 "Cancellable", 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_repo_pull_with_options" ostree_repo_pull_with_options :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name_or_baseurl : TBasicType TUTF8
    Ptr GVariant ->                         -- options : TVariant
    Ptr OSTree.AsyncProgress.AsyncProgress -> -- progress : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Like 'GI.OSTree.Objects.Repo.repoPull', but supports an extensible set of flags.
The following are currently defined:

  * refs (as): Array of string refs
  * flags (i): An instance of 'GI.OSTree.Flags.RepoPullFlags'
  * subdir (s): Pull just this subdirectory
  * subdirs (as): Pull just these subdirectories
  * override-remote-name (s): If local, add this remote to refspec
  * gpg-verify (b): GPG verify commits
  * gpg-verify-summary (b): GPG verify summary
  * depth (i): How far in the history to traverse; default is 0, -1 means infinite
  * disable-static-deltas (b): Do not use static deltas
  * require-static-deltas (b): Require static deltas
  * override-commit-ids (as): Array of specific commit IDs to fetch for refs
  * dry-run (b): Only print information on what will be downloaded (requires static deltas)
  * override-url (s): Fetch objects from this URL if remote specifies no metalink in options
  * inherit-transaction (b): Don\'t initiate, finish or abort a transaction, usefult to do mutliple pulls in one transaction.
  * http-headers (a(ss)): Additional headers to add to all HTTP requests
  * update-frequency (u): Frequency to call the async progress callback in milliseconds, if any; only values higher than 0 are valid
-}
repoPullWithOptions ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@remoteNameOrBaseurl@/: Name of remote or file:\/\/ url -}
    -> GVariant
    {- ^ /@options@/: A GVariant a{sv} with an extensible set of flags. -}
    -> Maybe (b)
    {- ^ /@progress@/: Progress -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoPullWithOptions self remoteNameOrBaseurl options progress cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteNameOrBaseurl' <- textToCString remoteNameOrBaseurl
    options' <- unsafeManagedPtrGetPtr options
    maybeProgress <- case progress of
        Nothing -> return nullPtr
        Just jProgress -> do
            jProgress' <- unsafeManagedPtrCastPtr jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_pull_with_options self' remoteNameOrBaseurl' options' maybeProgress maybeCancellable
        touchManagedPtr self
        touchManagedPtr options
        whenJust progress touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem remoteNameOrBaseurl'
        return ()
     ) (do
        freeMem remoteNameOrBaseurl'
     )

data RepoPullWithOptionsMethodInfo
instance (signature ~ (T.Text -> GVariant -> Maybe (b) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoPullWithOptionsMethodInfo a signature where
    overloadedMethod _ = repoPullWithOptions

-- method Repo::query_object_storage_size
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sha256", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_size", argType = TBasicType TUInt64, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Size in bytes object occupies physically", 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 "Cancellable", 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_repo_query_object_storage_size" ostree_repo_query_object_storage_size :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- sha256 : TBasicType TUTF8
    Ptr Word64 ->                           -- out_size : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Return the size in bytes of object with checksum /@sha256@/, after any
compression has been applied.
-}
repoQueryObjectStorageSize ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@sha256@/: Checksum -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Word64)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoQueryObjectStorageSize self objtype sha256 cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    sha256' <- textToCString sha256
    outSize <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_query_object_storage_size self' objtype' sha256' outSize maybeCancellable
        outSize' <- peek outSize
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem sha256'
        freeMem outSize
        return outSize'
     ) (do
        freeMem sha256'
        freeMem outSize
     )

data RepoQueryObjectStorageSizeMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m (Word64)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoQueryObjectStorageSizeMethodInfo a signature where
    overloadedMethod _ = repoQueryObjectStorageSize

-- method Repo::read_commit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ref", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Ref or ASCII checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_root", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepoFile corresponding to the root", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_commit", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The resolved commit checksum", 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 "Cancellable", 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_repo_read_commit" ostree_repo_read_commit :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- ref : TBasicType TUTF8
    Ptr (Ptr Gio.File.File) ->              -- out_root : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr CString ->                          -- out_commit : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Load the content for /@rev@/ into /@outRoot@/.
-}
repoReadCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@ref@/: Ref or ASCII checksum -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Gio.File.File,T.Text)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoReadCommit self ref cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    ref' <- textToCString ref
    outRoot <- allocMem :: IO (Ptr (Ptr Gio.File.File))
    outCommit <- allocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_read_commit self' ref' outRoot outCommit maybeCancellable
        outRoot' <- peek outRoot
        outRoot'' <- (wrapObject Gio.File.File) outRoot'
        outCommit' <- peek outCommit
        outCommit'' <- cstringToText outCommit'
        freeMem outCommit'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem ref'
        freeMem outRoot
        freeMem outCommit
        return (outRoot'', outCommit'')
     ) (do
        freeMem ref'
        freeMem outRoot
        freeMem outCommit
     )

data RepoReadCommitMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m (Gio.File.File,T.Text)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoReadCommitMethodInfo a signature where
    overloadedMethod _ = repoReadCommit

-- method Repo::read_commit_detached_metadata
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII SHA256 commit checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_metadata", argType = TVariant, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Metadata associated with commit in with format \"a{sv}\", or %NULL if none exists", 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 "Cancellable", 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_repo_read_commit_detached_metadata" ostree_repo_read_commit_detached_metadata :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr (Ptr GVariant) ->                   -- out_metadata : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
OSTree commits can have arbitrary metadata associated; this
function retrieves them.  If none exists, /@outMetadata@/ will be set
to 'Nothing'.
-}
repoReadCommitDetachedMetadata ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@checksum@/: ASCII SHA256 commit checksum -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (GVariant)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoReadCommitDetachedMetadata self checksum cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    checksum' <- textToCString checksum
    outMetadata <- allocMem :: IO (Ptr (Ptr GVariant))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_read_commit_detached_metadata self' checksum' outMetadata maybeCancellable
        outMetadata' <- peek outMetadata
        outMetadata'' <- wrapGVariantPtr outMetadata'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        freeMem outMetadata
        return outMetadata''
     ) (do
        freeMem checksum'
        freeMem outMetadata
     )

data RepoReadCommitDetachedMetadataMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m (GVariant)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoReadCommitDetachedMetadataMethodInfo a signature where
    overloadedMethod _ = repoReadCommitDetachedMetadata

-- method Repo::regenerate_summary
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "additional_metadata", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A GVariant of type a{sv}, or %NULL", 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 "Cancellable", 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_repo_regenerate_summary" ostree_repo_regenerate_summary :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr GVariant ->                         -- additional_metadata : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
An OSTree repository can contain a high level \"summary\" file that
describes the available branches and other metadata.

It is regenerated automatically after a commit if
@core\/commit-update-summary@ is set.
-}
repoRegenerateSummary ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (GVariant)
    {- ^ /@additionalMetadata@/: A GVariant of type a{sv}, or 'Nothing' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRegenerateSummary self additionalMetadata cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeAdditionalMetadata <- case additionalMetadata of
        Nothing -> return nullPtr
        Just jAdditionalMetadata -> do
            jAdditionalMetadata' <- unsafeManagedPtrGetPtr jAdditionalMetadata
            return jAdditionalMetadata'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_regenerate_summary self' maybeAdditionalMetadata maybeCancellable
        touchManagedPtr self
        whenJust additionalMetadata touchManagedPtr
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoRegenerateSummaryMethodInfo
instance (signature ~ (Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRegenerateSummaryMethodInfo a signature where
    overloadedMethod _ = repoRegenerateSummary

-- method Repo::reload_config
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "repo", 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 "cancellable", 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_repo_reload_config" ostree_repo_reload_config :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
By default, an 'GI.OSTree.Objects.Repo.Repo' will cache the remote configuration and its
own repo\/config data.  This API can be used to reload it.
-}
repoReloadConfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: repo -}
    -> Maybe (b)
    {- ^ /@cancellable@/: cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoReloadConfig self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_reload_config self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoReloadConfigMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoReloadConfigMethodInfo a signature where
    overloadedMethod _ = repoReloadConfig

-- method Repo::remote_add
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "url", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "URL for remote (if URL begins with metalink=, it will be used as such)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "GVariant of type a{sv}", 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 "Cancellable", 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_repo_remote_add" ostree_repo_remote_add :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- url : TBasicType TUTF8
    Ptr GVariant ->                         -- options : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Create a new remote named /@name@/ pointing to /@url@/.  If /@options@/ is
provided, then it will be mapped to 'GI.GLib.Structs.KeyFile.KeyFile' entries, where the
GVariant dictionary key is an option string, and the value is
mapped as follows:
  * s: 'GI.GLib.Structs.KeyFile.keyFileSetString'
  * b: 'GI.GLib.Structs.KeyFile.keyFileSetBoolean'
  * as: 'GI.GLib.Structs.KeyFile.keyFileSetStringList'
-}
repoRemoteAdd ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@name@/: Name of remote -}
    -> T.Text
    {- ^ /@url@/: URL for remote (if URL begins with metalink=, it will be used as such) -}
    -> Maybe (GVariant)
    {- ^ /@options@/: GVariant of type a{sv} -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteAdd self name url options cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    url' <- textToCString url
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrGetPtr jOptions
            return jOptions'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_add self' name' url' maybeOptions maybeCancellable
        touchManagedPtr self
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem name'
        freeMem url'
        return ()
     ) (do
        freeMem name'
        freeMem url'
     )

data RepoRemoteAddMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteAddMethodInfo a signature where
    overloadedMethod _ = repoRemoteAdd

-- method Repo::remote_change
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "sysroot", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "System root", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "changeop", argType = TInterface (Name {namespace = "OSTree", name = "RepoRemoteChange"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Operation to perform", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "url", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "URL for remote (if URL begins with metalink=, it will be used as such)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "GVariant of type a{sv}", 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 "Cancellable", 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_repo_remote_change" ostree_repo_remote_change :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.File.File ->                    -- sysroot : TInterface (Name {namespace = "Gio", name = "File"})
    CUInt ->                                -- changeop : TInterface (Name {namespace = "OSTree", name = "RepoRemoteChange"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- url : TBasicType TUTF8
    Ptr GVariant ->                         -- options : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
A combined function handling the equivalent of
'GI.OSTree.Objects.Repo.repoRemoteAdd', 'GI.OSTree.Objects.Repo.repoRemoteDelete', with more
options.
-}
repoRemoteChange ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (b)
    {- ^ /@sysroot@/: System root -}
    -> OSTree.Enums.RepoRemoteChange
    {- ^ /@changeop@/: Operation to perform -}
    -> T.Text
    {- ^ /@name@/: Name of remote -}
    -> T.Text
    {- ^ /@url@/: URL for remote (if URL begins with metalink=, it will be used as such) -}
    -> Maybe (GVariant)
    {- ^ /@options@/: GVariant of type a{sv} -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteChange self sysroot changeop name url options cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeSysroot <- case sysroot of
        Nothing -> return nullPtr
        Just jSysroot -> do
            jSysroot' <- unsafeManagedPtrCastPtr jSysroot
            return jSysroot'
    let changeop' = (fromIntegral . fromEnum) changeop
    name' <- textToCString name
    url' <- textToCString url
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrGetPtr jOptions
            return jOptions'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_change self' maybeSysroot changeop' name' url' maybeOptions maybeCancellable
        touchManagedPtr self
        whenJust sysroot touchManagedPtr
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem name'
        freeMem url'
        return ()
     ) (do
        freeMem name'
        freeMem url'
     )

data RepoRemoteChangeMethodInfo
instance (signature ~ (Maybe (b) -> OSTree.Enums.RepoRemoteChange -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoRemoteChangeMethodInfo a signature where
    overloadedMethod _ = repoRemoteChange

-- method Repo::remote_delete
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", 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 "Cancellable", 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_repo_remote_delete" ostree_repo_remote_delete :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Delete the remote named /@name@/.  It is an error if the provided
remote does not exist.
-}
repoRemoteDelete ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@name@/: Name of remote -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteDelete self name cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_delete self' name' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem name'
        return ()
     ) (do
        freeMem name'
     )

data RepoRemoteDeleteMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteDeleteMethodInfo a signature where
    overloadedMethod _ = repoRemoteDelete

-- method Repo::remote_fetch_summary
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Self", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "name of a remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_summary", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for raw summary data, or\n              %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_signatures", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for raw summary\n                 signature data, or %NULL", 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_repo_remote_fetch_summary" ostree_repo_remote_fetch_summary :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GLib.Bytes.Bytes) ->           -- out_summary : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr (Ptr GLib.Bytes.Bytes) ->           -- out_signatures : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Tries to fetch the summary file and any GPG signatures on the summary file
over HTTP, and returns the binary data in /@outSummary@/ and /@outSignatures@/
respectively.

If no summary file exists on the remote server, /@outSummary@/ is set to
/@nULL@/.  Likewise if the summary file is not signed, /@outSignatures@/ is
set to /@nULL@/.  In either case the function still returns 'True'.

Parse the summary data into a 'GVariant' using 'GI.GLib.Structs.Variant.variantNewFromBytes'
with @/OSTREE_SUMMARY_GVARIANT_FORMAT/@ as the format string.
-}
repoRemoteFetchSummary ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Self -}
    -> T.Text
    {- ^ /@name@/: name of a remote -}
    -> Maybe (b)
    {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> m (GLib.Bytes.Bytes,GLib.Bytes.Bytes)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteFetchSummary self name cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    outSummary <- allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    outSignatures <- allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_fetch_summary self' name' outSummary outSignatures maybeCancellable
        outSummary' <- peek outSummary
        outSummary'' <- (wrapBoxed GLib.Bytes.Bytes) outSummary'
        outSignatures' <- peek outSignatures
        outSignatures'' <- (wrapBoxed GLib.Bytes.Bytes) outSignatures'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem name'
        freeMem outSummary
        freeMem outSignatures
        return (outSummary'', outSignatures'')
     ) (do
        freeMem name'
        freeMem outSummary
        freeMem outSignatures
     )

data RepoRemoteFetchSummaryMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m (GLib.Bytes.Bytes,GLib.Bytes.Bytes)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteFetchSummaryMethodInfo a signature where
    overloadedMethod _ = repoRemoteFetchSummary

-- method Repo::remote_fetch_summary_with_options
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Self", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "name of a remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "options", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A GVariant a{sv} with an extensible set of flags", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_summary", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for raw summary data, or\n              %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "out_signatures", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for raw summary\n                 signature data, or %NULL", 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_repo_remote_fetch_summary_with_options" ostree_repo_remote_fetch_summary_with_options :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr GVariant ->                         -- options : TVariant
    Ptr (Ptr GLib.Bytes.Bytes) ->           -- out_summary : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr (Ptr GLib.Bytes.Bytes) ->           -- out_signatures : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Like 'GI.OSTree.Objects.Repo.repoRemoteFetchSummary', but supports an extensible set of flags.
The following are currently defined:

* override-url (s): Fetch summary from this URL if remote specifies no metalink in options
-}
repoRemoteFetchSummaryWithOptions ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Self -}
    -> T.Text
    {- ^ /@name@/: name of a remote -}
    -> Maybe (GVariant)
    {- ^ /@options@/: A GVariant a{sv} with an extensible set of flags -}
    -> Maybe (b)
    {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> m (GLib.Bytes.Bytes,GLib.Bytes.Bytes)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteFetchSummaryWithOptions self name options cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    maybeOptions <- case options of
        Nothing -> return nullPtr
        Just jOptions -> do
            jOptions' <- unsafeManagedPtrGetPtr jOptions
            return jOptions'
    outSummary <- allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    outSignatures <- allocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_fetch_summary_with_options self' name' maybeOptions outSummary outSignatures maybeCancellable
        outSummary' <- peek outSummary
        outSummary'' <- (wrapBoxed GLib.Bytes.Bytes) outSummary'
        outSignatures' <- peek outSignatures
        outSignatures'' <- (wrapBoxed GLib.Bytes.Bytes) outSignatures'
        touchManagedPtr self
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem name'
        freeMem outSummary
        freeMem outSignatures
        return (outSummary'', outSignatures'')
     ) (do
        freeMem name'
        freeMem outSummary
        freeMem outSignatures
     )

data RepoRemoteFetchSummaryWithOptionsMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> Maybe (b) -> m (GLib.Bytes.Bytes,GLib.Bytes.Bytes)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteFetchSummaryWithOptionsMethodInfo a signature where
    overloadedMethod _ = repoRemoteFetchSummaryWithOptions

-- method Repo::remote_get_gpg_verify
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_gpg_verify", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Remote's GPG option", 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_repo_remote_get_gpg_verify" ostree_repo_remote_get_gpg_verify :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr CInt ->                             -- out_gpg_verify : TBasicType TBoolean
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Return whether GPG verification is enabled for the remote named /@name@/
through /@outGpgVerify@/.  It is an error if the provided remote does
not exist.
-}
repoRemoteGetGpgVerify ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@name@/: Name of remote -}
    -> m (Bool)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteGetGpgVerify self name = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    outGpgVerify <- allocMem :: IO (Ptr CInt)
    onException (do
        _ <- propagateGError $ ostree_repo_remote_get_gpg_verify self' name' outGpgVerify
        outGpgVerify' <- peek outGpgVerify
        let outGpgVerify'' = (/= 0) outGpgVerify'
        touchManagedPtr self
        freeMem name'
        freeMem outGpgVerify
        return outGpgVerify''
     ) (do
        freeMem name'
        freeMem outGpgVerify
     )

data RepoRemoteGetGpgVerifyMethodInfo
instance (signature ~ (T.Text -> m (Bool)), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteGetGpgVerifyMethodInfo a signature where
    overloadedMethod _ = repoRemoteGetGpgVerify

-- method Repo::remote_get_gpg_verify_summary
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_gpg_verify_summary", argType = TBasicType TBoolean, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Remote's GPG option", 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_repo_remote_get_gpg_verify_summary" ostree_repo_remote_get_gpg_verify_summary :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr CInt ->                             -- out_gpg_verify_summary : TBasicType TBoolean
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Return whether GPG verification of the summary is enabled for the remote
named /@name@/ through /@outGpgVerifySummary@/.  It is an error if the provided
remote does not exist.
-}
repoRemoteGetGpgVerifySummary ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@name@/: Name of remote -}
    -> m (Bool)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteGetGpgVerifySummary self name = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    outGpgVerifySummary <- allocMem :: IO (Ptr CInt)
    onException (do
        _ <- propagateGError $ ostree_repo_remote_get_gpg_verify_summary self' name' outGpgVerifySummary
        outGpgVerifySummary' <- peek outGpgVerifySummary
        let outGpgVerifySummary'' = (/= 0) outGpgVerifySummary'
        touchManagedPtr self
        freeMem name'
        freeMem outGpgVerifySummary
        return outGpgVerifySummary''
     ) (do
        freeMem name'
        freeMem outGpgVerifySummary
     )

data RepoRemoteGetGpgVerifySummaryMethodInfo
instance (signature ~ (T.Text -> m (Bool)), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteGetGpgVerifySummaryMethodInfo a signature where
    overloadedMethod _ = repoRemoteGetGpgVerifySummary

-- method Repo::remote_get_url
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_url", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Remote's URL", 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_repo_remote_get_url" ostree_repo_remote_get_url :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr CString ->                          -- out_url : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Return the URL of the remote named /@name@/ through /@outUrl@/.  It is an
error if the provided remote does not exist.
-}
repoRemoteGetUrl ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@name@/: Name of remote -}
    -> m (T.Text)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteGetUrl self name = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    outUrl <- allocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_remote_get_url self' name' outUrl
        outUrl' <- peek outUrl
        outUrl'' <- cstringToText outUrl'
        freeMem outUrl'
        touchManagedPtr self
        freeMem name'
        freeMem outUrl
        return outUrl''
     ) (do
        freeMem name'
        freeMem outUrl
     )

data RepoRemoteGetUrlMethodInfo
instance (signature ~ (T.Text -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteGetUrlMethodInfo a signature where
    overloadedMethod _ = repoRemoteGetUrl

-- method Repo::remote_gpg_import
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Self", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "name of a remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "source_stream", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GInputStream, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key_ids", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a %NULL-terminated array of GPG key IDs, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_imported", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "return location for the number of imported\n                             keys, or %NULL", 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_repo_remote_gpg_import" ostree_repo_remote_gpg_import :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr Gio.InputStream.InputStream ->      -- source_stream : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Ptr CString ->                          -- key_ids : TCArray True (-1) (-1) (TBasicType TUTF8)
    Word32 ->                               -- out_imported : TBasicType TUInt
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Imports one or more GPG keys from the open /@sourceStream@/, or from the
user\'s personal keyring if /@sourceStream@/ is 'Nothing'.  The /@keyIds@/ array
can optionally restrict which keys are imported.  If /@keyIds@/ is 'Nothing',
then all keys are imported.

The imported keys will be used to conduct GPG verification when pulling
from the remote named /@name@/.
-}
repoRemoteGpgImport ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Self -}
    -> T.Text
    {- ^ /@name@/: name of a remote -}
    -> Maybe (b)
    {- ^ /@sourceStream@/: a 'GI.Gio.Objects.InputStream.InputStream', or 'Nothing' -}
    -> Maybe ([T.Text])
    {- ^ /@keyIds@/: a 'Nothing'-terminated array of GPG key IDs, or 'Nothing' -}
    -> Word32
    {- ^ /@outImported@/: return location for the number of imported
                             keys, or 'Nothing' -}
    -> Maybe (c)
    {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteGpgImport self name sourceStream keyIds outImported cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    name' <- textToCString name
    maybeSourceStream <- case sourceStream of
        Nothing -> return nullPtr
        Just jSourceStream -> do
            jSourceStream' <- unsafeManagedPtrCastPtr jSourceStream
            return jSourceStream'
    maybeKeyIds <- case keyIds of
        Nothing -> return nullPtr
        Just jKeyIds -> do
            jKeyIds' <- packZeroTerminatedUTF8CArray jKeyIds
            return jKeyIds'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_gpg_import self' name' maybeSourceStream maybeKeyIds outImported maybeCancellable
        touchManagedPtr self
        whenJust sourceStream touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem name'
        mapZeroTerminatedCArray freeMem maybeKeyIds
        freeMem maybeKeyIds
        return ()
     ) (do
        freeMem name'
        mapZeroTerminatedCArray freeMem maybeKeyIds
        freeMem maybeKeyIds
     )

data RepoRemoteGpgImportMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe ([T.Text]) -> Word32 -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoRemoteGpgImportMethodInfo a signature where
    overloadedMethod _ = repoRemoteGpgImport

-- method Repo::remote_list
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_n_remotes", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of remotes available", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : [Arg {argCName = "out_n_remotes", argType = TBasicType TUInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of remotes available", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- returnType : Just (TCArray False (-1) 1 (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_remote_list" ostree_repo_remote_list :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Word32 ->                           -- out_n_remotes : TBasicType TUInt
    IO (Ptr CString)

{- |
List available remote names in an 'GI.OSTree.Objects.Repo.Repo'.  Remote names are sorted
alphabetically.  If no remotes are available the function returns 'Nothing'.
-}
repoRemoteList ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> m [T.Text]
    {- ^ __Returns:__ a 'Nothing'-terminated
         array of remote names -}
repoRemoteList self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    outNRemotes <- allocMem :: IO (Ptr Word32)
    result <- ostree_repo_remote_list self' outNRemotes
    outNRemotes' <- peek outNRemotes
    checkUnexpectedReturnNULL "repoRemoteList" result
    result' <- (unpackUTF8CArrayWithLength outNRemotes') result
    (mapCArrayWithLength outNRemotes') freeMem result
    freeMem result
    touchManagedPtr self
    freeMem outNRemotes
    return result'

data RepoRemoteListMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsRepo a) => O.MethodInfo RepoRemoteListMethodInfo a signature where
    overloadedMethod _ = repoRemoteList

-- method Repo::remote_list_refs
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of the remote.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_all_refs", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Mapping from ref to checksum", 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 "Cancellable", 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_repo_remote_list_refs" ostree_repo_remote_list_refs :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    Ptr (Ptr (GHashTable CString CString)) -> -- out_all_refs : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
/No description available in the introspection data./
-}
repoRemoteListRefs ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@remoteName@/: Name of the remote. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ((Map.Map T.Text T.Text))
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoRemoteListRefs self remoteName cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteName' <- textToCString remoteName
    outAllRefs <- allocMem :: IO (Ptr (Ptr (GHashTable CString CString)))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_list_refs self' remoteName' outAllRefs maybeCancellable
        outAllRefs' <- peek outAllRefs
        outAllRefs'' <- unpackGHashTable outAllRefs'
        let outAllRefs''' = mapFirst cstringUnpackPtr outAllRefs''
        outAllRefs'''' <- mapFirstA cstringToText outAllRefs'''
        let outAllRefs''''' = mapSecond cstringUnpackPtr outAllRefs''''
        outAllRefs'''''' <- mapSecondA cstringToText outAllRefs'''''
        let outAllRefs''''''' = Map.fromList outAllRefs''''''
        unrefGHashTable outAllRefs'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem remoteName'
        freeMem outAllRefs
        return outAllRefs'''''''
     ) (do
        freeMem remoteName'
        freeMem outAllRefs
     )

data RepoRemoteListRefsMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ((Map.Map T.Text T.Text))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoRemoteListRefsMethodInfo a signature where
    overloadedMethod _ = repoRemoteListRefs

-- method Repo::resolve_rev
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "refspec", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A refspec", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "allow_noent", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Do not throw an error if refspec does not exist", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_rev", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A checksum,or %NULL if @allow_noent is true and it does not exist", 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_repo_resolve_rev" ostree_repo_resolve_rev :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- refspec : TBasicType TUTF8
    CInt ->                                 -- allow_noent : TBasicType TBoolean
    Ptr CString ->                          -- out_rev : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Look up the given refspec, returning the checksum it references in
the parameter /@outRev@/. Will fall back on remote directory if cannot
find the given refspec in local.
-}
repoResolveRev ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@refspec@/: A refspec -}
    -> Bool
    {- ^ /@allowNoent@/: Do not throw an error if refspec does not exist -}
    -> m (T.Text)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoResolveRev self refspec allowNoent = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    refspec' <- textToCString refspec
    let allowNoent' = (fromIntegral . fromEnum) allowNoent
    outRev <- allocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_resolve_rev self' refspec' allowNoent' outRev
        outRev' <- peek outRev
        outRev'' <- cstringToText outRev'
        freeMem outRev'
        touchManagedPtr self
        freeMem refspec'
        freeMem outRev
        return outRev''
     ) (do
        freeMem refspec'
        freeMem outRev
     )

data RepoResolveRevMethodInfo
instance (signature ~ (T.Text -> Bool -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoResolveRevMethodInfo a signature where
    overloadedMethod _ = repoResolveRev

-- method Repo::resolve_rev_ext
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "refspec", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A refspec", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "allow_noent", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Do not throw an error if refspec does not exist", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "OSTree", name = "RepoResolveRevExtFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Options controlling behavior", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_rev", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A checksum,or %NULL if @allow_noent is true and it does not exist", 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_repo_resolve_rev_ext" ostree_repo_resolve_rev_ext :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- refspec : TBasicType TUTF8
    CInt ->                                 -- allow_noent : TBasicType TBoolean
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoResolveRevExtFlags"})
    Ptr CString ->                          -- out_rev : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Look up the given refspec, returning the checksum it references in
the parameter /@outRev@/. Differently from 'GI.OSTree.Objects.Repo.repoResolveRev',
this will not fall back to searching through remote repos if a
local ref is specified but not found.
-}
repoResolveRevExt ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@refspec@/: A refspec -}
    -> Bool
    {- ^ /@allowNoent@/: Do not throw an error if refspec does not exist -}
    -> OSTree.Enums.RepoResolveRevExtFlags
    {- ^ /@flags@/: Options controlling behavior -}
    -> m (T.Text)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoResolveRevExt self refspec allowNoent flags = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    refspec' <- textToCString refspec
    let allowNoent' = (fromIntegral . fromEnum) allowNoent
    let flags' = (fromIntegral . fromEnum) flags
    outRev <- allocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_resolve_rev_ext self' refspec' allowNoent' flags' outRev
        outRev' <- peek outRev
        outRev'' <- cstringToText outRev'
        freeMem outRev'
        touchManagedPtr self
        freeMem refspec'
        freeMem outRev
        return outRev''
     ) (do
        freeMem refspec'
        freeMem outRev
     )

data RepoResolveRevExtMethodInfo
instance (signature ~ (T.Text -> Bool -> OSTree.Enums.RepoResolveRevExtFlags -> m (T.Text)), MonadIO m, IsRepo a) => O.MethodInfo RepoResolveRevExtMethodInfo a signature where
    overloadedMethod _ = repoResolveRevExt

-- method Repo::scan_hardlinks
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", 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 "Cancellable", 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_repo_scan_hardlinks" ostree_repo_scan_hardlinks :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
When ostree builds a mutable tree from directory like in
'GI.OSTree.Objects.Repo.repoWriteDirectoryToMtree', it has to scan all files that you
pass in and compute their checksums. If your commit contains hardlinks from
ostree\'s existing repo, ostree can build a mapping of device numbers and
inodes to their checksum.

There is an upfront cost to creating this mapping, as this will scan the
entire objects directory. If your commit is composed of mostly hardlinks to
existing ostree objects, then this will speed up considerably, so call it
before you call @/ostree_write_directory_to_mtree()/@ or similar.
-}
repoScanHardlinks ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoScanHardlinks self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_scan_hardlinks self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoScanHardlinksMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoScanHardlinksMethodInfo a signature where
    overloadedMethod _ = repoScanHardlinks

-- method Repo::set_cache_dir
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dfd", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "directory fd", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "subpath in @dfd", 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_repo_set_cache_dir" ostree_repo_set_cache_dir :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Int32 ->                                -- dfd : TBasicType TInt
    CString ->                              -- path : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Set a custom location for the cache directory used for e.g.
per-remote summary caches. Setting this manually is useful when
doing operations on a system repo as a user because you don\'t have
write permissions in the repo, where the cache is normally stored.
-}
repoSetCacheDir ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> Int32
    {- ^ /@dfd@/: directory fd -}
    -> T.Text
    {- ^ /@path@/: subpath in /@dfd@/ -}
    -> Maybe (b)
    {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoSetCacheDir self dfd path cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    path' <- textToCString path
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_set_cache_dir self' dfd path' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem path'
        return ()
     ) (do
        freeMem path'
     )

data RepoSetCacheDirMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSetCacheDirMethodInfo a signature where
    overloadedMethod _ = repoSetCacheDir

-- method Repo::set_disable_fsync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "disable_fsync", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "If %TRUE, do not fsync", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_set_disable_fsync" ostree_repo_set_disable_fsync :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CInt ->                                 -- disable_fsync : TBasicType TBoolean
    IO ()

{- |
Disable requests to @/fsync()/@ to stable storage during commits.  This
option should only be used by build system tools which are creating
disposable virtual machines, or have higher level mechanisms for
ensuring data consistency.
-}
repoSetDisableFsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> Bool
    {- ^ /@disableFsync@/: If 'True', do not fsync -}
    -> m ()
repoSetDisableFsync self disableFsync = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let disableFsync' = (fromIntegral . fromEnum) disableFsync
    ostree_repo_set_disable_fsync self' disableFsync'
    touchManagedPtr self
    return ()

data RepoSetDisableFsyncMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoSetDisableFsyncMethodInfo a signature where
    overloadedMethod _ = repoSetDisableFsync

-- method Repo::set_ref_immediate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A remote for the ref", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ref", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The ref to write", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The checksum to point it to, or %NULL to unset", 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 "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_repo_set_ref_immediate" ostree_repo_set_ref_immediate :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote : TBasicType TUTF8
    CString ->                              -- ref : TBasicType TUTF8
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
This is like 'GI.OSTree.Objects.Repo.repoTransactionSetRef', except it may be
invoked outside of a transaction.  This is presently safe for the
case where we\'re creating or overwriting an existing ref.
-}
repoSetRefImmediate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> Maybe (T.Text)
    {- ^ /@remote@/: A remote for the ref -}
    -> T.Text
    {- ^ /@ref@/: The ref to write -}
    -> Maybe (T.Text)
    {- ^ /@checksum@/: The checksum to point it to, or 'Nothing' to unset -}
    -> Maybe (b)
    {- ^ /@cancellable@/: GCancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoSetRefImmediate self remote ref checksum cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeRemote <- case remote of
        Nothing -> return nullPtr
        Just jRemote -> do
            jRemote' <- textToCString jRemote
            return jRemote'
    ref' <- textToCString ref
    maybeChecksum <- case checksum of
        Nothing -> return nullPtr
        Just jChecksum -> do
            jChecksum' <- textToCString jChecksum
            return jChecksum'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_set_ref_immediate self' maybeRemote ref' maybeChecksum maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem maybeRemote
        freeMem ref'
        freeMem maybeChecksum
        return ()
     ) (do
        freeMem maybeRemote
        freeMem ref'
        freeMem maybeChecksum
     )

data RepoSetRefImmediateMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSetRefImmediateMethodInfo a signature where
    overloadedMethod _ = repoSetRefImmediate

-- method Repo::sign_commit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Self", 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 = "key_id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Use this GPG key id", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "homedir", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "GPG home directory, or %NULL", 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_repo_sign_commit" ostree_repo_sign_commit :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    CString ->                              -- key_id : TBasicType TUTF8
    CString ->                              -- homedir : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Add a GPG signature to a commit.
-}
repoSignCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Self -}
    -> T.Text
    {- ^ /@commitChecksum@/: SHA256 of given commit to sign -}
    -> T.Text
    {- ^ /@keyId@/: Use this GPG key id -}
    -> Maybe (T.Text)
    {- ^ /@homedir@/: GPG home directory, or 'Nothing' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoSignCommit self commitChecksum keyId homedir cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    commitChecksum' <- textToCString commitChecksum
    keyId' <- textToCString keyId
    maybeHomedir <- case homedir of
        Nothing -> return nullPtr
        Just jHomedir -> do
            jHomedir' <- textToCString jHomedir
            return jHomedir'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_sign_commit self' commitChecksum' keyId' maybeHomedir maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        freeMem keyId'
        freeMem maybeHomedir
        return ()
     ) (do
        freeMem commitChecksum'
        freeMem keyId'
        freeMem maybeHomedir
     )

data RepoSignCommitMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSignCommitMethodInfo a signature where
    overloadedMethod _ = repoSignCommit

-- method Repo::sign_delta
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "from_commit", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "to_commit", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key_id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "homedir", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Nothing, 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_repo_sign_delta" ostree_repo_sign_delta :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- from_commit : TBasicType TUTF8
    CString ->                              -- to_commit : TBasicType TUTF8
    CString ->                              -- key_id : TBasicType TUTF8
    CString ->                              -- homedir : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
This function is deprecated, sign the summary file instead.
Add a GPG signature to a static delta.
-}
repoSignDelta ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -> T.Text
    -> T.Text
    -> T.Text
    -> T.Text
    -> Maybe (b)
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoSignDelta self fromCommit toCommit keyId homedir cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    fromCommit' <- textToCString fromCommit
    toCommit' <- textToCString toCommit
    keyId' <- textToCString keyId
    homedir' <- textToCString homedir
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_sign_delta self' fromCommit' toCommit' keyId' homedir' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem fromCommit'
        freeMem toCommit'
        freeMem keyId'
        freeMem homedir'
        return ()
     ) (do
        freeMem fromCommit'
        freeMem toCommit'
        freeMem keyId'
        freeMem homedir'
     )

data RepoSignDeltaMethodInfo
instance (signature ~ (T.Text -> T.Text -> T.Text -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoSignDeltaMethodInfo a signature where
    overloadedMethod _ = repoSignDelta

-- method Repo::static_delta_execute_offline
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dir_or_file", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Path to a directory containing static delta data, or directly to the superblock", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "skip_validation", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "If %TRUE, assume data integrity", 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 "Cancellable", 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_repo_static_delta_execute_offline" ostree_repo_static_delta_execute_offline :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.File.File ->                    -- dir_or_file : TInterface (Name {namespace = "Gio", name = "File"})
    CInt ->                                 -- skip_validation : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Given a directory representing an already-downloaded static delta
on disk, apply it, generating a new commit.  The directory must be
named with the form \"FROM-TO\", where both are checksums, and it
must contain a file named \"superblock\", along with at least one part.
-}
repoStaticDeltaExecuteOffline ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> b
    {- ^ /@dirOrFile@/: Path to a directory containing static delta data, or directly to the superblock -}
    -> Bool
    {- ^ /@skipValidation@/: If 'True', assume data integrity -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoStaticDeltaExecuteOffline self dirOrFile skipValidation cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    dirOrFile' <- unsafeManagedPtrCastPtr dirOrFile
    let skipValidation' = (fromIntegral . fromEnum) skipValidation
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_static_delta_execute_offline self' dirOrFile' skipValidation' maybeCancellable
        touchManagedPtr self
        touchManagedPtr dirOrFile
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoStaticDeltaExecuteOfflineMethodInfo
instance (signature ~ (b -> Bool -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoStaticDeltaExecuteOfflineMethodInfo a signature where
    overloadedMethod _ = repoStaticDeltaExecuteOffline

-- method Repo::static_delta_generate
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "opt", argType = TInterface (Name {namespace = "OSTree", name = "StaticDeltaGenerateOpt"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "High level optimization choice", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "from", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum of origin, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "to", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum of target", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "metadata", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Optional metadata", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "params", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Parameters, see below", 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 "Cancellable", 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_repo_static_delta_generate" ostree_repo_static_delta_generate :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- opt : TInterface (Name {namespace = "OSTree", name = "StaticDeltaGenerateOpt"})
    CString ->                              -- from : TBasicType TUTF8
    CString ->                              -- to : TBasicType TUTF8
    Ptr GVariant ->                         -- metadata : TVariant
    Ptr GVariant ->                         -- params : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Generate a lookaside \"static delta\" from /@from@/ ('Nothing' means
from-empty) which can generate the objects in /@to@/.  This delta is
an optimization over fetching individual objects, and can be
conveniently stored and applied offline.

The /@params@/ argument should be an a{sv}.  The following attributes
are known:
  - min-fallback-size: u: Minimum uncompressed size in megabytes to use fallback, 0 to disable fallbacks
  - max-chunk-size: u: Maximum size in megabytes of a delta part
  - max-bsdiff-size: u: Maximum size in megabytes to consider bsdiff compression
  for input files
  - compression: y: Compression type: 0=none, x=lzma, g=gzip
  - bsdiff-enabled: b: Enable bsdiff compression.  Default TRUE.
  - inline-parts: b: Put part data in header, to get a single file delta.  Default FALSE.
  - verbose: b: Print diagnostic messages.  Default FALSE.
  - endianness: b: Deltas use host byte order by default; this option allows choosing (G_BIG_ENDIAN or G_LITTLE_ENDIAN)
  - filename: ay: Save delta superblock to this filename, and parts in the same directory.  Default saves to repository.
-}
repoStaticDeltaGenerate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.StaticDeltaGenerateOpt
    {- ^ /@opt@/: High level optimization choice -}
    -> T.Text
    {- ^ /@from@/: ASCII SHA256 checksum of origin, or 'Nothing' -}
    -> T.Text
    {- ^ /@to@/: ASCII SHA256 checksum of target -}
    -> Maybe (GVariant)
    {- ^ /@metadata@/: Optional metadata -}
    -> Maybe (GVariant)
    {- ^ /@params@/: Parameters, see below -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoStaticDeltaGenerate self opt from to metadata params cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let opt' = (fromIntegral . fromEnum) opt
    from' <- textToCString from
    to' <- textToCString to
    maybeMetadata <- case metadata of
        Nothing -> return nullPtr
        Just jMetadata -> do
            jMetadata' <- unsafeManagedPtrGetPtr jMetadata
            return jMetadata'
    maybeParams <- case params of
        Nothing -> return nullPtr
        Just jParams -> do
            jParams' <- unsafeManagedPtrGetPtr jParams
            return jParams'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_static_delta_generate self' opt' from' to' maybeMetadata maybeParams maybeCancellable
        touchManagedPtr self
        whenJust metadata touchManagedPtr
        whenJust params touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem from'
        freeMem to'
        return ()
     ) (do
        freeMem from'
        freeMem to'
     )

data RepoStaticDeltaGenerateMethodInfo
instance (signature ~ (OSTree.Enums.StaticDeltaGenerateOpt -> T.Text -> T.Text -> Maybe (GVariant) -> Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoStaticDeltaGenerateMethodInfo a signature where
    overloadedMethod _ = repoStaticDeltaGenerate

-- method Repo::transaction_set_ref
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A remote for the ref", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ref", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The ref to write", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The checksum to point it to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_transaction_set_ref" ostree_repo_transaction_set_ref :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote : TBasicType TUTF8
    CString ->                              -- ref : TBasicType TUTF8
    CString ->                              -- checksum : TBasicType TUTF8
    IO ()

{- |
If /@checksum@/ is not 'Nothing', then record it as the target of ref named
/@ref@/; if /@remote@/ is provided, the ref will appear to originate from that
remote.

Otherwise, if /@checksum@/ is 'Nothing', then record that the ref should
be deleted.

The change will not be written out immediately, but when the transaction
is completed with 'GI.OSTree.Objects.Repo.repoCommitTransaction'. If the transaction
is instead aborted with 'GI.OSTree.Objects.Repo.repoAbortTransaction', no changes will
be made to the repository.
-}
repoTransactionSetRef ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> Maybe (T.Text)
    {- ^ /@remote@/: A remote for the ref -}
    -> T.Text
    {- ^ /@ref@/: The ref to write -}
    -> T.Text
    {- ^ /@checksum@/: The checksum to point it to -}
    -> m ()
repoTransactionSetRef self remote ref checksum = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeRemote <- case remote of
        Nothing -> return nullPtr
        Just jRemote -> do
            jRemote' <- textToCString jRemote
            return jRemote'
    ref' <- textToCString ref
    checksum' <- textToCString checksum
    ostree_repo_transaction_set_ref self' maybeRemote ref' checksum'
    touchManagedPtr self
    freeMem maybeRemote
    freeMem ref'
    freeMem checksum'
    return ()

data RepoTransactionSetRefMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> T.Text -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoTransactionSetRefMethodInfo a signature where
    overloadedMethod _ = repoTransactionSetRef

-- method Repo::transaction_set_refspec
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "refspec", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The refspec to write", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The checksum to point it to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_transaction_set_refspec" ostree_repo_transaction_set_refspec :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- refspec : TBasicType TUTF8
    CString ->                              -- checksum : TBasicType TUTF8
    IO ()

{- |
Like 'GI.OSTree.Objects.Repo.repoTransactionSetRef', but takes concatenated
/@refspec@/ format as input instead of separate remote and name
arguments.
-}
repoTransactionSetRefspec ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> T.Text
    {- ^ /@refspec@/: The refspec to write -}
    -> T.Text
    {- ^ /@checksum@/: The checksum to point it to -}
    -> m ()
repoTransactionSetRefspec self refspec checksum = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    refspec' <- textToCString refspec
    checksum' <- textToCString checksum
    ostree_repo_transaction_set_refspec self' refspec' checksum'
    touchManagedPtr self
    freeMem refspec'
    freeMem checksum'
    return ()

data RepoTransactionSetRefspecMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoTransactionSetRefspecMethodInfo a signature where
    overloadedMethod _ = repoTransactionSetRefspec

-- XXX Could not generate method Repo::traverse_commit
-- Error was : Not implemented: "GHashTable element of type TVariant unsupported."
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoTraverseCommitMethodInfo
instance (p ~ (), o ~ O.MethodResolutionFailed "traverseCommit" Repo) => O.MethodInfo RepoTraverseCommitMethodInfo o p where
    overloadedMethod _ = undefined
-- method Repo::verify_commit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repository", 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 "ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "keyringdir", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Path to directory GPG keyrings; overrides built-in default if given", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "extra_keyring", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Path to additional keyring file (not a directory)", 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 "Cancellable", 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_repo_verify_commit" ostree_repo_verify_commit :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    Ptr Gio.File.File ->                    -- keyringdir : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.File.File ->                    -- extra_keyring : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Check for a valid GPG signature on commit named by the ASCII
checksum /@commitChecksum@/.
-}
repoVerifyCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) =>
    a
    {- ^ /@self@/: Repository -}
    -> T.Text
    {- ^ /@commitChecksum@/: ASCII SHA256 checksum -}
    -> Maybe (b)
    {- ^ /@keyringdir@/: Path to directory GPG keyrings; overrides built-in default if given -}
    -> Maybe (c)
    {- ^ /@extraKeyring@/: Path to additional keyring file (not a directory) -}
    -> Maybe (d)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoVerifyCommit self commitChecksum keyringdir extraKeyring cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    commitChecksum' <- textToCString commitChecksum
    maybeKeyringdir <- case keyringdir of
        Nothing -> return nullPtr
        Just jKeyringdir -> do
            jKeyringdir' <- unsafeManagedPtrCastPtr jKeyringdir
            return jKeyringdir'
    maybeExtraKeyring <- case extraKeyring of
        Nothing -> return nullPtr
        Just jExtraKeyring -> do
            jExtraKeyring' <- unsafeManagedPtrCastPtr jExtraKeyring
            return jExtraKeyring'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_verify_commit self' commitChecksum' maybeKeyringdir maybeExtraKeyring maybeCancellable
        touchManagedPtr self
        whenJust keyringdir touchManagedPtr
        whenJust extraKeyring touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        return ()
     ) (do
        freeMem commitChecksum'
     )

data RepoVerifyCommitMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (c) -> Maybe (d) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoVerifyCommitMethodInfo a signature where
    overloadedMethod _ = repoVerifyCommit

-- method Repo::verify_commit_ext
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repository", 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 "ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "keyringdir", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Path to directory GPG keyrings; overrides built-in default if given", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "extra_keyring", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Path to additional keyring file (not a directory)", 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 "Cancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"}))
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_verify_commit_ext" ostree_repo_verify_commit_ext :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    Ptr Gio.File.File ->                    -- keyringdir : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.File.File ->                    -- extra_keyring : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr OSTree.GpgVerifyResult.GpgVerifyResult)

{- |
Read GPG signature(s) on the commit named by the ASCII checksum
/@commitChecksum@/ and return detailed results.
-}
repoVerifyCommitExt ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) =>
    a
    {- ^ /@self@/: Repository -}
    -> T.Text
    {- ^ /@commitChecksum@/: ASCII SHA256 checksum -}
    -> Maybe (b)
    {- ^ /@keyringdir@/: Path to directory GPG keyrings; overrides built-in default if given -}
    -> Maybe (c)
    {- ^ /@extraKeyring@/: Path to additional keyring file (not a directory) -}
    -> Maybe (d)
    {- ^ /@cancellable@/: Cancellable -}
    -> m OSTree.GpgVerifyResult.GpgVerifyResult
    {- ^ __Returns:__ an 'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoVerifyCommitExt self commitChecksum keyringdir extraKeyring cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    commitChecksum' <- textToCString commitChecksum
    maybeKeyringdir <- case keyringdir of
        Nothing -> return nullPtr
        Just jKeyringdir -> do
            jKeyringdir' <- unsafeManagedPtrCastPtr jKeyringdir
            return jKeyringdir'
    maybeExtraKeyring <- case extraKeyring of
        Nothing -> return nullPtr
        Just jExtraKeyring -> do
            jExtraKeyring' <- unsafeManagedPtrCastPtr jExtraKeyring
            return jExtraKeyring'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_verify_commit_ext self' commitChecksum' maybeKeyringdir maybeExtraKeyring maybeCancellable
        checkUnexpectedReturnNULL "repoVerifyCommitExt" result
        result' <- (wrapObject OSTree.GpgVerifyResult.GpgVerifyResult) result
        touchManagedPtr self
        whenJust keyringdir touchManagedPtr
        whenJust extraKeyring touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        return result'
     ) (do
        freeMem commitChecksum'
     )

data RepoVerifyCommitExtMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (c) -> Maybe (d) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.File.IsFile b, Gio.File.IsFile c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoVerifyCommitExtMethodInfo a signature where
    overloadedMethod _ = repoVerifyCommitExt

-- method Repo::verify_commit_for_remote
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repository", 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 "ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "OSTree remote to use for configuration", 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 "Cancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"}))
-- throws : True
-- Skip return : False

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

{- |
Read GPG signature(s) on the commit named by the ASCII checksum
/@commitChecksum@/ and return detailed results, based on the keyring
configured for /@remote@/.
-}
repoVerifyCommitForRemote ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repository -}
    -> T.Text
    {- ^ /@commitChecksum@/: ASCII SHA256 checksum -}
    -> T.Text
    {- ^ /@remoteName@/: OSTree remote to use for configuration -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m OSTree.GpgVerifyResult.GpgVerifyResult
    {- ^ __Returns:__ an 'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoVerifyCommitForRemote self commitChecksum remoteName cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    commitChecksum' <- textToCString commitChecksum
    remoteName' <- textToCString remoteName
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_verify_commit_for_remote self' commitChecksum' remoteName' maybeCancellable
        checkUnexpectedReturnNULL "repoVerifyCommitForRemote" result
        result' <- (wrapObject OSTree.GpgVerifyResult.GpgVerifyResult) result
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        freeMem remoteName'
        return result'
     ) (do
        freeMem commitChecksum'
        freeMem remoteName'
     )

data RepoVerifyCommitForRemoteMethodInfo
instance (signature ~ (T.Text -> T.Text -> Maybe (b) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoVerifyCommitForRemoteMethodInfo a signature where
    overloadedMethod _ = repoVerifyCommitForRemote

-- method Repo::verify_summary
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "remote_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Name of remote", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "summary", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Summary data as a #GBytes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "signatures", argType = TInterface (Name {namespace = "GLib", name = "Bytes"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Summary signatures as a #GBytes", 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 "Cancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "OSTree", name = "GpgVerifyResult"}))
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_verify_summary" ostree_repo_verify_summary :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    Ptr GLib.Bytes.Bytes ->                 -- summary : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr GLib.Bytes.Bytes ->                 -- signatures : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr OSTree.GpgVerifyResult.GpgVerifyResult)

{- |
Verify /@signatures@/ for /@summary@/ data using GPG keys in the keyring for
/@remoteName@/, and return an 'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'.
-}
repoVerifySummary ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@remoteName@/: Name of remote -}
    -> GLib.Bytes.Bytes
    {- ^ /@summary@/: Summary data as a 'GI.GLib.Structs.Bytes.Bytes' -}
    -> GLib.Bytes.Bytes
    {- ^ /@signatures@/: Summary signatures as a 'GI.GLib.Structs.Bytes.Bytes' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m OSTree.GpgVerifyResult.GpgVerifyResult
    {- ^ __Returns:__ an 'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoVerifySummary self remoteName summary signatures cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    remoteName' <- textToCString remoteName
    summary' <- unsafeManagedPtrGetPtr summary
    signatures' <- unsafeManagedPtrGetPtr signatures
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_verify_summary self' remoteName' summary' signatures' maybeCancellable
        checkUnexpectedReturnNULL "repoVerifySummary" result
        result' <- (wrapObject OSTree.GpgVerifyResult.GpgVerifyResult) result
        touchManagedPtr self
        touchManagedPtr summary
        touchManagedPtr signatures
        whenJust cancellable touchManagedPtr
        freeMem remoteName'
        return result'
     ) (do
        freeMem remoteName'
     )

data RepoVerifySummaryMethodInfo
instance (signature ~ (T.Text -> GLib.Bytes.Bytes -> GLib.Bytes.Bytes -> Maybe (b) -> m OSTree.GpgVerifyResult.GpgVerifyResult), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoVerifySummaryMethodInfo a signature where
    overloadedMethod _ = repoVerifySummary

-- method Repo::write_archive_to_mtree
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "archive", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A path to an archive file", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mtree", argType = TInterface (Name {namespace = "OSTree", name = "MutableTree"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #OstreeMutableTree to write to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "modifier", argType = TInterface (Name {namespace = "OSTree", name = "RepoCommitModifier"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Optional commit modifier", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "autocreate_parents", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Autocreate parent directories", 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 "Cancellable", 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_repo_write_archive_to_mtree" ostree_repo_write_archive_to_mtree :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.File.File ->                    -- archive : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr OSTree.MutableTree.MutableTree ->   -- mtree : TInterface (Name {namespace = "OSTree", name = "MutableTree"})
    Ptr OSTree.RepoCommitModifier.RepoCommitModifier -> -- modifier : TInterface (Name {namespace = "OSTree", name = "RepoCommitModifier"})
    CInt ->                                 -- autocreate_parents : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Import an archive file /@archive@/ into the repository, and write its
file structure to /@mtree@/.
-}
repoWriteArchiveToMtree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) =>
    a
    {- ^ /@self@/: An 'GI.OSTree.Objects.Repo.Repo' -}
    -> b
    {- ^ /@archive@/: A path to an archive file -}
    -> c
    {- ^ /@mtree@/: The 'GI.OSTree.Objects.MutableTree.MutableTree' to write to -}
    -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier)
    {- ^ /@modifier@/: Optional commit modifier -}
    -> Bool
    {- ^ /@autocreateParents@/: Autocreate parent directories -}
    -> Maybe (d)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteArchiveToMtree self archive mtree modifier autocreateParents cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    archive' <- unsafeManagedPtrCastPtr archive
    mtree' <- unsafeManagedPtrCastPtr mtree
    maybeModifier <- case modifier of
        Nothing -> return nullPtr
        Just jModifier -> do
            jModifier' <- unsafeManagedPtrGetPtr jModifier
            return jModifier'
    let autocreateParents' = (fromIntegral . fromEnum) autocreateParents
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_archive_to_mtree self' archive' mtree' maybeModifier autocreateParents' maybeCancellable
        touchManagedPtr self
        touchManagedPtr archive
        touchManagedPtr mtree
        whenJust modifier touchManagedPtr
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoWriteArchiveToMtreeMethodInfo
instance (signature ~ (b -> c -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier) -> Bool -> Maybe (d) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoWriteArchiveToMtreeMethodInfo a signature where
    overloadedMethod _ = repoWriteArchiveToMtree

-- method Repo::write_commit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum for parent, or %NULL for none", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "subject", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Subject", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "body", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Body", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "metadata", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "GVariant of type a{sv}, or %NULL for none", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "root", argType = TInterface (Name {namespace = "OSTree", name = "RepoFile"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The tree to point the commit to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_commit", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Resulting ASCII SHA256 checksum for commit", 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 "Cancellable", 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_repo_write_commit" ostree_repo_write_commit :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- parent : TBasicType TUTF8
    CString ->                              -- subject : TBasicType TUTF8
    CString ->                              -- body : TBasicType TUTF8
    Ptr GVariant ->                         -- metadata : TVariant
    Ptr OSTree.RepoFile.RepoFile ->         -- root : TInterface (Name {namespace = "OSTree", name = "RepoFile"})
    Ptr CString ->                          -- out_commit : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Write a commit metadata object, referencing /@rootContentsChecksum@/
and /@rootMetadataChecksum@/.
-}
repoWriteCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (T.Text)
    {- ^ /@parent@/: ASCII SHA256 checksum for parent, or 'Nothing' for none -}
    -> Maybe (T.Text)
    {- ^ /@subject@/: Subject -}
    -> Maybe (T.Text)
    {- ^ /@body@/: Body -}
    -> Maybe (GVariant)
    {- ^ /@metadata@/: GVariant of type a{sv}, or 'Nothing' for none -}
    -> b
    {- ^ /@root@/: The tree to point the commit to -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (T.Text)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteCommit self parent subject body metadata root cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- textToCString jParent
            return jParent'
    maybeSubject <- case subject of
        Nothing -> return nullPtr
        Just jSubject -> do
            jSubject' <- textToCString jSubject
            return jSubject'
    maybeBody <- case body of
        Nothing -> return nullPtr
        Just jBody -> do
            jBody' <- textToCString jBody
            return jBody'
    maybeMetadata <- case metadata of
        Nothing -> return nullPtr
        Just jMetadata -> do
            jMetadata' <- unsafeManagedPtrGetPtr jMetadata
            return jMetadata'
    root' <- unsafeManagedPtrCastPtr root
    outCommit <- allocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_commit self' maybeParent maybeSubject maybeBody maybeMetadata root' outCommit maybeCancellable
        outCommit' <- peek outCommit
        outCommit'' <- cstringToText outCommit'
        freeMem outCommit'
        touchManagedPtr self
        whenJust metadata touchManagedPtr
        touchManagedPtr root
        whenJust cancellable touchManagedPtr
        freeMem maybeParent
        freeMem maybeSubject
        freeMem maybeBody
        freeMem outCommit
        return outCommit''
     ) (do
        freeMem maybeParent
        freeMem maybeSubject
        freeMem maybeBody
        freeMem outCommit
     )

data RepoWriteCommitMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (T.Text) -> Maybe (T.Text) -> Maybe (GVariant) -> b -> Maybe (c) -> m (T.Text)), MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteCommitMethodInfo a signature where
    overloadedMethod _ = repoWriteCommit

-- method Repo::write_commit_detached_metadata
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "ASCII SHA256 commit checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "metadata", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Metadata to associate with commit in with format \"a{sv}\", or %NULL to delete", 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 "Cancellable", 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_repo_write_commit_detached_metadata" ostree_repo_write_commit_detached_metadata :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr GVariant ->                         -- metadata : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Replace any existing metadata associated with commit referred to by
/@checksum@/ with /@metadata@/.  If /@metadata@/ is 'Nothing', then existing
data will be deleted.
-}
repoWriteCommitDetachedMetadata ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@checksum@/: ASCII SHA256 commit checksum -}
    -> Maybe (GVariant)
    {- ^ /@metadata@/: Metadata to associate with commit in with format \"a{sv}\", or 'Nothing' to delete -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteCommitDetachedMetadata self checksum metadata cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    checksum' <- textToCString checksum
    maybeMetadata <- case metadata of
        Nothing -> return nullPtr
        Just jMetadata -> do
            jMetadata' <- unsafeManagedPtrGetPtr jMetadata
            return jMetadata'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_commit_detached_metadata self' checksum' maybeMetadata maybeCancellable
        touchManagedPtr self
        whenJust metadata touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

data RepoWriteCommitDetachedMetadataMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteCommitDetachedMetadataMethodInfo a signature where
    overloadedMethod _ = repoWriteCommitDetachedMetadata

-- method Repo::write_commit_with_time
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "ASCII SHA256 checksum for parent, or %NULL for none", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "subject", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Subject", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "body", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Body", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "metadata", argType = TVariant, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "GVariant of type a{sv}, or %NULL for none", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "root", argType = TInterface (Name {namespace = "OSTree", name = "RepoFile"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The tree to point the commit to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "time", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The time to use to stamp the commit", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_commit", argType = TBasicType TUTF8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Resulting ASCII SHA256 checksum for commit", 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 "Cancellable", 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_repo_write_commit_with_time" ostree_repo_write_commit_with_time :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- parent : TBasicType TUTF8
    CString ->                              -- subject : TBasicType TUTF8
    CString ->                              -- body : TBasicType TUTF8
    Ptr GVariant ->                         -- metadata : TVariant
    Ptr OSTree.RepoFile.RepoFile ->         -- root : TInterface (Name {namespace = "OSTree", name = "RepoFile"})
    Word64 ->                               -- time : TBasicType TUInt64
    Ptr CString ->                          -- out_commit : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Write a commit metadata object, referencing /@rootContentsChecksum@/
and /@rootMetadataChecksum@/.
-}
repoWriteCommitWithTime ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (T.Text)
    {- ^ /@parent@/: ASCII SHA256 checksum for parent, or 'Nothing' for none -}
    -> Maybe (T.Text)
    {- ^ /@subject@/: Subject -}
    -> Maybe (T.Text)
    {- ^ /@body@/: Body -}
    -> Maybe (GVariant)
    {- ^ /@metadata@/: GVariant of type a{sv}, or 'Nothing' for none -}
    -> b
    {- ^ /@root@/: The tree to point the commit to -}
    -> Word64
    {- ^ /@time@/: The time to use to stamp the commit -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (T.Text)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteCommitWithTime self parent subject body metadata root time cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- textToCString jParent
            return jParent'
    maybeSubject <- case subject of
        Nothing -> return nullPtr
        Just jSubject -> do
            jSubject' <- textToCString jSubject
            return jSubject'
    maybeBody <- case body of
        Nothing -> return nullPtr
        Just jBody -> do
            jBody' <- textToCString jBody
            return jBody'
    maybeMetadata <- case metadata of
        Nothing -> return nullPtr
        Just jMetadata -> do
            jMetadata' <- unsafeManagedPtrGetPtr jMetadata
            return jMetadata'
    root' <- unsafeManagedPtrCastPtr root
    outCommit <- allocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_commit_with_time self' maybeParent maybeSubject maybeBody maybeMetadata root' time outCommit maybeCancellable
        outCommit' <- peek outCommit
        outCommit'' <- cstringToText outCommit'
        freeMem outCommit'
        touchManagedPtr self
        whenJust metadata touchManagedPtr
        touchManagedPtr root
        whenJust cancellable touchManagedPtr
        freeMem maybeParent
        freeMem maybeSubject
        freeMem maybeBody
        freeMem outCommit
        return outCommit''
     ) (do
        freeMem maybeParent
        freeMem maybeSubject
        freeMem maybeBody
        freeMem outCommit
     )

data RepoWriteCommitWithTimeMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (T.Text) -> Maybe (T.Text) -> Maybe (GVariant) -> b -> Word64 -> Maybe (c) -> m (T.Text)), MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteCommitWithTimeMethodInfo a signature where
    overloadedMethod _ = repoWriteCommitWithTime

-- method Repo::write_config
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "new_config", argType = TInterface (Name {namespace = "GLib", name = "KeyFile"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Overwrite the config file with this data.  Do not change later!", 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_repo_write_config" ostree_repo_write_config :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr GLib.KeyFile.KeyFile ->             -- new_config : TInterface (Name {namespace = "GLib", name = "KeyFile"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Save /@newConfig@/ in place of this repository\'s config file.  Note
that /@newConfig@/ should not be modified after - this function
simply adds a reference.
-}
repoWriteConfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    {- ^ /@self@/: Repo -}
    -> GLib.KeyFile.KeyFile
    {- ^ /@newConfig@/: Overwrite the config file with this data.  Do not change later! -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteConfig self newConfig = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    newConfig' <- unsafeManagedPtrGetPtr newConfig
    onException (do
        _ <- propagateGError $ ostree_repo_write_config self' newConfig'
        touchManagedPtr self
        touchManagedPtr newConfig
        return ()
     ) (do
        return ()
     )

data RepoWriteConfigMethodInfo
instance (signature ~ (GLib.KeyFile.KeyFile -> m ()), MonadIO m, IsRepo a) => O.MethodInfo RepoWriteConfigMethodInfo a signature where
    overloadedMethod _ = repoWriteConfig

-- method Repo::write_content
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "expected_checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "If provided, validate content against this checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_input", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Content object stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Length of @object_input", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_csum", argType = TCArray False 32 (-1) (TBasicType TUInt8), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Binary checksum", 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 "Cancellable", 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_repo_write_content" ostree_repo_write_content :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- expected_checksum : TBasicType TUTF8
    Ptr Gio.InputStream.InputStream ->      -- object_input : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Word64 ->                               -- length : TBasicType TUInt64
    Ptr (Ptr Word8) ->                      -- out_csum : TCArray False 32 (-1) (TBasicType TUInt8)
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Store the content object streamed as /@objectInput@/,
with total length /@length@/.  The actual checksum will
be returned as /@outCsum@/.
-}
repoWriteContent ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (T.Text)
    {- ^ /@expectedChecksum@/: If provided, validate content against this checksum -}
    -> b
    {- ^ /@objectInput@/: Content object stream -}
    -> Word64
    {- ^ /@length@/: Length of /@objectInput@/ -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (ByteString)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteContent self expectedChecksum objectInput length_ cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeExpectedChecksum <- case expectedChecksum of
        Nothing -> return nullPtr
        Just jExpectedChecksum -> do
            jExpectedChecksum' <- textToCString jExpectedChecksum
            return jExpectedChecksum'
    objectInput' <- unsafeManagedPtrCastPtr objectInput
    outCsum <- allocMem :: IO (Ptr (Ptr Word8))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_content self' maybeExpectedChecksum objectInput' length_ outCsum maybeCancellable
        outCsum' <- peek outCsum
        outCsum'' <- (unpackByteStringWithLength 32) outCsum'
        freeMem outCsum'
        touchManagedPtr self
        touchManagedPtr objectInput
        whenJust cancellable touchManagedPtr
        freeMem maybeExpectedChecksum
        freeMem outCsum
        return outCsum''
     ) (do
        freeMem maybeExpectedChecksum
        freeMem outCsum
     )

data RepoWriteContentMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> Word64 -> Maybe (c) -> m (ByteString)), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteContentMethodInfo a signature where
    overloadedMethod _ = repoWriteContent

-- method Repo::write_content_async
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "expected_checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "If provided, validate content against this checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Input", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Length of @object", 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 "Cancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Invoked when content is writed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data for @callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_write_content_async" ostree_repo_write_content_async :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- expected_checksum : TBasicType TUTF8
    Ptr Gio.InputStream.InputStream ->      -- object : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Word64 ->                               -- length : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Asynchronously store the content object /@object@/.  If provided, the
checksum /@expectedChecksum@/ will be verified.
-}
repoWriteContentAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> Maybe (T.Text)
    {- ^ /@expectedChecksum@/: If provided, validate content against this checksum -}
    -> b
    {- ^ /@object@/: Input -}
    -> Word64
    {- ^ /@length@/: Length of /@object@/ -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: Invoked when content is writed -}
    -> m ()
repoWriteContentAsync self expectedChecksum object length_ cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeExpectedChecksum <- case expectedChecksum of
        Nothing -> return nullPtr
        Just jExpectedChecksum -> do
            jExpectedChecksum' <- textToCString jExpectedChecksum
            return jExpectedChecksum'
    object' <- unsafeManagedPtrCastPtr object
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    ostree_repo_write_content_async self' maybeExpectedChecksum object' length_ maybeCancellable maybeCallback userData
    touchManagedPtr self
    touchManagedPtr object
    whenJust cancellable touchManagedPtr
    freeMem maybeExpectedChecksum
    return ()

data RepoWriteContentAsyncMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> Word64 -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteContentAsyncMethodInfo a signature where
    overloadedMethod _ = repoWriteContentAsync

-- method Repo::write_content_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #OstreeRepo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_csum", argType = TBasicType TUInt8, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A binary SHA256 checksum of the content object", 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_repo_write_content_finish" ostree_repo_write_content_finish :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr Word8 ->                            -- out_csum : TBasicType TUInt8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Completes an invocation of 'GI.OSTree.Objects.Repo.repoWriteContentAsync'.
-}
repoWriteContentFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@self@/: a 'GI.OSTree.Objects.Repo.Repo' -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult' -}
    -> m (Word8)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteContentFinish self result_ = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result_' <- unsafeManagedPtrCastPtr result_
    outCsum <- allocMem :: IO (Ptr Word8)
    onException (do
        _ <- propagateGError $ ostree_repo_write_content_finish self' result_' outCsum
        outCsum' <- peek outCsum
        touchManagedPtr self
        touchManagedPtr result_
        freeMem outCsum
        return outCsum'
     ) (do
        freeMem outCsum
     )

data RepoWriteContentFinishMethodInfo
instance (signature ~ (b -> m (Word8)), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo RepoWriteContentFinishMethodInfo a signature where
    overloadedMethod _ = repoWriteContentFinish

-- method Repo::write_content_trusted
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Store content using this ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_input", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Content stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Length of @object_input", 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 "Cancellable", 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_repo_write_content_trusted" ostree_repo_write_content_trusted :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr Gio.InputStream.InputStream ->      -- object_input : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Word64 ->                               -- length : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Store the content object streamed as /@objectInput@/, with total
length /@length@/.  The given /@checksum@/ will be treated as trusted.

This function should be used when importing file objects from local
disk, for example.
-}
repoWriteContentTrusted ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> T.Text
    {- ^ /@checksum@/: Store content using this ASCII SHA256 checksum -}
    -> b
    {- ^ /@objectInput@/: Content stream -}
    -> Word64
    {- ^ /@length@/: Length of /@objectInput@/ -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteContentTrusted self checksum objectInput length_ cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    checksum' <- textToCString checksum
    objectInput' <- unsafeManagedPtrCastPtr objectInput
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_content_trusted self' checksum' objectInput' length_ maybeCancellable
        touchManagedPtr self
        touchManagedPtr objectInput
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

data RepoWriteContentTrustedMethodInfo
instance (signature ~ (T.Text -> b -> Word64 -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteContentTrustedMethodInfo a signature where
    overloadedMethod _ = repoWriteContentTrusted

-- method Repo::write_dfd_to_mtree
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dfd", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Directory file descriptor", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Path", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mtree", argType = TInterface (Name {namespace = "OSTree", name = "MutableTree"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Overlay directory contents into this tree", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "modifier", argType = TInterface (Name {namespace = "OSTree", name = "RepoCommitModifier"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Optional modifier", 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 "Cancellable", 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_repo_write_dfd_to_mtree" ostree_repo_write_dfd_to_mtree :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Int32 ->                                -- dfd : TBasicType TInt
    CString ->                              -- path : TBasicType TUTF8
    Ptr OSTree.MutableTree.MutableTree ->   -- mtree : TInterface (Name {namespace = "OSTree", name = "MutableTree"})
    Ptr OSTree.RepoCommitModifier.RepoCommitModifier -> -- modifier : TInterface (Name {namespace = "OSTree", name = "RepoCommitModifier"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Store as objects all contents of the directory referred to by /@dfd@/
and /@path@/ all children into the repository /@self@/, overlaying the
resulting filesystem hierarchy into /@mtree@/.
-}
repoWriteDfdToMtree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> Int32
    {- ^ /@dfd@/: Directory file descriptor -}
    -> T.Text
    {- ^ /@path@/: Path -}
    -> b
    {- ^ /@mtree@/: Overlay directory contents into this tree -}
    -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier)
    {- ^ /@modifier@/: Optional modifier -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteDfdToMtree self dfd path mtree modifier cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    path' <- textToCString path
    mtree' <- unsafeManagedPtrCastPtr mtree
    maybeModifier <- case modifier of
        Nothing -> return nullPtr
        Just jModifier -> do
            jModifier' <- unsafeManagedPtrGetPtr jModifier
            return jModifier'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_dfd_to_mtree self' dfd path' mtree' maybeModifier maybeCancellable
        touchManagedPtr self
        touchManagedPtr mtree
        whenJust modifier touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem path'
        return ()
     ) (do
        freeMem path'
     )

data RepoWriteDfdToMtreeMethodInfo
instance (signature ~ (Int32 -> T.Text -> b -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier) -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteDfdToMtreeMethodInfo a signature where
    overloadedMethod _ = repoWriteDfdToMtree

-- method Repo::write_directory_to_mtree
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dir", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Path to a directory", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mtree", argType = TInterface (Name {namespace = "OSTree", name = "MutableTree"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Overlay directory contents into this tree", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "modifier", argType = TInterface (Name {namespace = "OSTree", name = "RepoCommitModifier"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Optional modifier", 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 "Cancellable", 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_repo_write_directory_to_mtree" ostree_repo_write_directory_to_mtree :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.File.File ->                    -- dir : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr OSTree.MutableTree.MutableTree ->   -- mtree : TInterface (Name {namespace = "OSTree", name = "MutableTree"})
    Ptr OSTree.RepoCommitModifier.RepoCommitModifier -> -- modifier : TInterface (Name {namespace = "OSTree", name = "RepoCommitModifier"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Store objects for /@dir@/ and all children into the repository /@self@/,
overlaying the resulting filesystem hierarchy into /@mtree@/.
-}
repoWriteDirectoryToMtree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) =>
    a
    {- ^ /@self@/: Repo -}
    -> b
    {- ^ /@dir@/: Path to a directory -}
    -> c
    {- ^ /@mtree@/: Overlay directory contents into this tree -}
    -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier)
    {- ^ /@modifier@/: Optional modifier -}
    -> Maybe (d)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteDirectoryToMtree self dir mtree modifier cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    dir' <- unsafeManagedPtrCastPtr dir
    mtree' <- unsafeManagedPtrCastPtr mtree
    maybeModifier <- case modifier of
        Nothing -> return nullPtr
        Just jModifier -> do
            jModifier' <- unsafeManagedPtrGetPtr jModifier
            return jModifier'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_directory_to_mtree self' dir' mtree' maybeModifier maybeCancellable
        touchManagedPtr self
        touchManagedPtr dir
        touchManagedPtr mtree
        whenJust modifier touchManagedPtr
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data RepoWriteDirectoryToMtreeMethodInfo
instance (signature ~ (b -> c -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier) -> Maybe (d) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.MutableTree.IsMutableTree c, Gio.Cancellable.IsCancellable d) => O.MethodInfo RepoWriteDirectoryToMtreeMethodInfo a signature where
    overloadedMethod _ = repoWriteDirectoryToMtree

-- method Repo::write_metadata
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "expected_checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "If provided, validate content against this checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Metadata", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_csum", argType = TCArray False 32 (-1) (TBasicType TUInt8), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Binary checksum", 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 "Cancellable", 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_repo_write_metadata" ostree_repo_write_metadata :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- expected_checksum : TBasicType TUTF8
    Ptr GVariant ->                         -- object : TVariant
    Ptr (Ptr Word8) ->                      -- out_csum : TCArray False 32 (-1) (TBasicType TUInt8)
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Store the metadata object /@variant@/.  Return the checksum
as /@outCsum@/.

If /@expectedChecksum@/ is not 'Nothing', verify it against the
computed checksum.
-}
repoWriteMetadata ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> Maybe (T.Text)
    {- ^ /@expectedChecksum@/: If provided, validate content against this checksum -}
    -> GVariant
    {- ^ /@object@/: Metadata -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (ByteString)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteMetadata self objtype expectedChecksum object cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    maybeExpectedChecksum <- case expectedChecksum of
        Nothing -> return nullPtr
        Just jExpectedChecksum -> do
            jExpectedChecksum' <- textToCString jExpectedChecksum
            return jExpectedChecksum'
    object' <- unsafeManagedPtrGetPtr object
    outCsum <- allocMem :: IO (Ptr (Ptr Word8))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_metadata self' objtype' maybeExpectedChecksum object' outCsum maybeCancellable
        outCsum' <- peek outCsum
        outCsum'' <- (unpackByteStringWithLength 32) outCsum'
        freeMem outCsum'
        touchManagedPtr self
        touchManagedPtr object
        whenJust cancellable touchManagedPtr
        freeMem maybeExpectedChecksum
        freeMem outCsum
        return outCsum''
     ) (do
        freeMem maybeExpectedChecksum
        freeMem outCsum
     )

data RepoWriteMetadataMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> Maybe (T.Text) -> GVariant -> Maybe (b) -> m (ByteString)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteMetadataMethodInfo a signature where
    overloadedMethod _ = repoWriteMetadata

-- method Repo::write_metadata_async
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "expected_checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "If provided, validate content against this checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Metadata", 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 "Cancellable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Invoked when metadata is writed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 6, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Data for @callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_write_metadata_async" ostree_repo_write_metadata_async :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- expected_checksum : TBasicType TUTF8
    Ptr GVariant ->                         -- object : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Asynchronously store the metadata object /@variant@/.  If provided,
the checksum /@expectedChecksum@/ will be verified.
-}
repoWriteMetadataAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> Maybe (T.Text)
    {- ^ /@expectedChecksum@/: If provided, validate content against this checksum -}
    -> GVariant
    {- ^ /@object@/: Metadata -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: Invoked when metadata is writed -}
    -> m ()
repoWriteMetadataAsync self objtype expectedChecksum object cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    maybeExpectedChecksum <- case expectedChecksum of
        Nothing -> return nullPtr
        Just jExpectedChecksum -> do
            jExpectedChecksum' <- textToCString jExpectedChecksum
            return jExpectedChecksum'
    object' <- unsafeManagedPtrGetPtr object
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    ostree_repo_write_metadata_async self' objtype' maybeExpectedChecksum object' maybeCancellable maybeCallback userData
    touchManagedPtr self
    touchManagedPtr object
    whenJust cancellable touchManagedPtr
    freeMem maybeExpectedChecksum
    return ()

data RepoWriteMetadataAsyncMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> Maybe (T.Text) -> GVariant -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteMetadataAsyncMethodInfo a signature where
    overloadedMethod _ = repoWriteMetadataAsync

-- method Repo::write_metadata_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_csum", argType = TBasicType TUInt8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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_repo_write_metadata_finish" ostree_repo_write_metadata_finish :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Word8 ->                                -- out_csum : TBasicType TUInt8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
/No description available in the introspection data./
-}
repoWriteMetadataFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -> b
    -> Word8
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteMetadataFinish self result_ outCsum = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ ostree_repo_write_metadata_finish self' result_' outCsum
        touchManagedPtr self
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data RepoWriteMetadataFinishMethodInfo
instance (signature ~ (b -> Word8 -> m ()), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo RepoWriteMetadataFinishMethodInfo a signature where
    overloadedMethod _ = repoWriteMetadataFinish

-- method Repo::write_metadata_stream_trusted
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Store object with this ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_input", argType = TInterface (Name {namespace = "Gio", name = "InputStream"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Metadata object stream", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Length, may be 0 for unknown", 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 "Cancellable", 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_repo_write_metadata_stream_trusted" ostree_repo_write_metadata_stream_trusted :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr Gio.InputStream.InputStream ->      -- object_input : TInterface (Name {namespace = "Gio", name = "InputStream"})
    Word64 ->                               -- length : TBasicType TUInt64
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Store the metadata object /@variant@/; the provided /@checksum@/ is
trusted.
-}
repoWriteMetadataStreamTrusted ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@checksum@/: Store object with this ASCII SHA256 checksum -}
    -> b
    {- ^ /@objectInput@/: Metadata object stream -}
    -> Word64
    {- ^ /@length@/: Length, may be 0 for unknown -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteMetadataStreamTrusted self objtype checksum objectInput length_ cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    checksum' <- textToCString checksum
    objectInput' <- unsafeManagedPtrCastPtr objectInput
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_metadata_stream_trusted self' objtype' checksum' objectInput' length_ maybeCancellable
        touchManagedPtr self
        touchManagedPtr objectInput
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

data RepoWriteMetadataStreamTrustedMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> b -> Word64 -> Maybe (c) -> m ()), MonadIO m, IsRepo a, Gio.InputStream.IsInputStream b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteMetadataStreamTrustedMethodInfo a signature where
    overloadedMethod _ = repoWriteMetadataStreamTrusted

-- method Repo::write_metadata_trusted
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "objtype", argType = TInterface (Name {namespace = "OSTree", name = "ObjectType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object type", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "checksum", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Store object with this ASCII SHA256 checksum", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "variant", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Metadata object", 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 "Cancellable", 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_repo_write_metadata_trusted" ostree_repo_write_metadata_trusted :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- objtype : TInterface (Name {namespace = "OSTree", name = "ObjectType"})
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr GVariant ->                         -- variant : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Store the metadata object /@variant@/; the provided /@checksum@/ is
trusted.
-}
repoWriteMetadataTrusted ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: Repo -}
    -> OSTree.Enums.ObjectType
    {- ^ /@objtype@/: Object type -}
    -> T.Text
    {- ^ /@checksum@/: Store object with this ASCII SHA256 checksum -}
    -> GVariant
    {- ^ /@variant@/: Metadata object -}
    -> Maybe (b)
    {- ^ /@cancellable@/: Cancellable -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteMetadataTrusted self objtype checksum variant cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objtype' = (fromIntegral . fromEnum) objtype
    checksum' <- textToCString checksum
    variant' <- unsafeManagedPtrGetPtr variant
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_metadata_trusted self' objtype' checksum' variant' maybeCancellable
        touchManagedPtr self
        touchManagedPtr variant
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

data RepoWriteMetadataTrustedMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> GVariant -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.MethodInfo RepoWriteMetadataTrustedMethodInfo a signature where
    overloadedMethod _ = repoWriteMetadataTrusted

-- method Repo::write_mtree
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "OSTree", name = "Repo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Repo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mtree", argType = TInterface (Name {namespace = "OSTree", name = "MutableTree"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Mutable tree", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_file", argType = TInterface (Name {namespace = "Gio", name = "File"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "An #OstreeRepoFile representing @mtree's root.", 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 "Cancellable", 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_repo_write_mtree" ostree_repo_write_mtree :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr OSTree.MutableTree.MutableTree ->   -- mtree : TInterface (Name {namespace = "OSTree", name = "MutableTree"})
    Ptr (Ptr Gio.File.File) ->              -- out_file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Write all metadata objects for /@mtree@/ to repo; the resulting
/@outFile@/ points to the 'GI.OSTree.Enums.ObjectTypeDirTree' object that
the /@mtree@/ represented.
-}
repoWriteMtree ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@self@/: Repo -}
    -> b
    {- ^ /@mtree@/: Mutable tree -}
    -> Maybe (c)
    {- ^ /@cancellable@/: Cancellable -}
    -> m (Gio.File.File)
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoWriteMtree self mtree cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    mtree' <- unsafeManagedPtrCastPtr mtree
    outFile <- allocMem :: IO (Ptr (Ptr Gio.File.File))
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_mtree self' mtree' outFile maybeCancellable
        outFile' <- peek outFile
        outFile'' <- (wrapObject Gio.File.File) outFile'
        touchManagedPtr self
        touchManagedPtr mtree
        whenJust cancellable touchManagedPtr
        freeMem outFile
        return outFile''
     ) (do
        freeMem outFile
     )

data RepoWriteMtreeMethodInfo
instance (signature ~ (b -> Maybe (c) -> m (Gio.File.File)), MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) => O.MethodInfo RepoWriteMtreeMethodInfo a signature where
    overloadedMethod _ = repoWriteMtree

-- method Repo::mode_from_string
-- method type : MemberFunction
-- Args : [Arg {argCName = "mode", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "out_mode", argType = TInterface (Name {namespace = "OSTree", name = "RepoMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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_repo_mode_from_string" ostree_repo_mode_from_string :: 
    CString ->                              -- mode : TBasicType TUTF8
    CUInt ->                                -- out_mode : TInterface (Name {namespace = "OSTree", name = "RepoMode"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
/No description available in the introspection data./
-}
repoModeFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -> OSTree.Enums.RepoMode
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
repoModeFromString mode outMode = liftIO $ do
    mode' <- textToCString mode
    let outMode' = (fromIntegral . fromEnum) outMode
    onException (do
        _ <- propagateGError $ ostree_repo_mode_from_string mode' outMode'
        freeMem mode'
        return ()
     ) (do
        freeMem mode'
     )

-- method Repo::pull_default_console_progress_changed
-- method type : MemberFunction
-- Args : [Arg {argCName = "progress", argType = TInterface (Name {namespace = "OSTree", name = "AsyncProgress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Async progress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_pull_default_console_progress_changed" ostree_repo_pull_default_console_progress_changed :: 
    Ptr OSTree.AsyncProgress.AsyncProgress -> -- progress : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Convenient \"changed\" callback for use with
'GI.OSTree.Objects.AsyncProgress.asyncProgressNewAndConnect' when pulling from a remote
repository.

Depending on the state of the 'GI.OSTree.Objects.AsyncProgress.AsyncProgress', either displays a
custom status message, or else outstanding fetch progress in bytes\/sec,
or else outstanding content or metadata writes to the repository in
number of objects.

Compatibility note: this function previously assumed that /@userData@/
was a pointer to a @/GSConsole/@ instance.  This is no longer the case,
and /@userData@/ is ignored.
-}
repoPullDefaultConsoleProgressChanged ::
    (B.CallStack.HasCallStack, MonadIO m, OSTree.AsyncProgress.IsAsyncProgress a) =>
    a
    {- ^ /@progress@/: Async progress -}
    -> Ptr ()
    {- ^ /@userData@/: User data -}
    -> m ()
repoPullDefaultConsoleProgressChanged progress userData = liftIO $ do
    progress' <- unsafeManagedPtrCastPtr progress
    ostree_repo_pull_default_console_progress_changed progress' userData
    touchManagedPtr progress
    return ()

-- XXX Could not generate method Repo::traverse_new_reachable
-- Error was : Not implemented: "GHashTable element of type TVariant unsupported."
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoTraverseNewReachableMethodInfo
instance (p ~ (), o ~ O.MethodResolutionFailed "traverseNewReachable" Repo) => O.MethodInfo RepoTraverseNewReachableMethodInfo o p where
    overloadedMethod _ = undefined