{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}


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

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

module GI.OSTree.Objects.Repo
    ( 
#if defined(ENABLE_OVERLOADING)
    RepoListCollectionRefsMethodInfo        ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoListCommitObjectsStartingWithMethodInfo,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoListObjectsMethodInfo               ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoListRefsMethodInfo                  ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoListRefsExtMethodInfo               ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoRemoteListCollectionRefsMethodInfo  ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoRemoteListRefsMethodInfo            ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoTraverseCommitMethodInfo            ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoTraverseReachableRefsMethodInfo     ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoTraverseNewParentsMethodInfo        ,
#endif
#if defined(ENABLE_OVERLOADING)
    RepoTraverseNewReachableMethodInfo      ,
#endif

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


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [abortTransaction]("GI.OSTree.Objects.Repo#g:method:abortTransaction"), [addGpgSignatureSummary]("GI.OSTree.Objects.Repo#g:method:addGpgSignatureSummary"), [appendGpgSignature]("GI.OSTree.Objects.Repo#g:method:appendGpgSignature"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [checkoutAt]("GI.OSTree.Objects.Repo#g:method:checkoutAt"), [checkoutComposefs]("GI.OSTree.Objects.Repo#g:method:checkoutComposefs"), [checkoutGc]("GI.OSTree.Objects.Repo#g:method:checkoutGc"), [checkoutTree]("GI.OSTree.Objects.Repo#g:method:checkoutTree"), [commitAddComposefsMetadata]("GI.OSTree.Objects.Repo#g:method:commitAddComposefsMetadata"), [commitTransaction]("GI.OSTree.Objects.Repo#g:method:commitTransaction"), [copyConfig]("GI.OSTree.Objects.Repo#g:method:copyConfig"), [create]("GI.OSTree.Objects.Repo#g:method:create"), [deleteObject]("GI.OSTree.Objects.Repo#g:method:deleteObject"), [equal]("GI.OSTree.Objects.Repo#g:method:equal"), [findRemotesAsync]("GI.OSTree.Objects.Repo#g:method:findRemotesAsync"), [findRemotesFinish]("GI.OSTree.Objects.Repo#g:method:findRemotesFinish"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [fsckObject]("GI.OSTree.Objects.Repo#g:method:fsckObject"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [gpgSignData]("GI.OSTree.Objects.Repo#g:method:gpgSignData"), [gpgVerifyData]("GI.OSTree.Objects.Repo#g:method:gpgVerifyData"), [hasObject]("GI.OSTree.Objects.Repo#g:method:hasObject"), [hash]("GI.OSTree.Objects.Repo#g:method:hash"), [importObjectFrom]("GI.OSTree.Objects.Repo#g:method:importObjectFrom"), [importObjectFromWithTrust]("GI.OSTree.Objects.Repo#g:method:importObjectFromWithTrust"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isSystem]("GI.OSTree.Objects.Repo#g:method:isSystem"), [isWritable]("GI.OSTree.Objects.Repo#g:method:isWritable"), [listCollectionRefs]("GI.OSTree.Objects.Repo#g:method:listCollectionRefs"), [listCommitObjectsStartingWith]("GI.OSTree.Objects.Repo#g:method:listCommitObjectsStartingWith"), [listObjects]("GI.OSTree.Objects.Repo#g:method:listObjects"), [listRefs]("GI.OSTree.Objects.Repo#g:method:listRefs"), [listRefsExt]("GI.OSTree.Objects.Repo#g:method:listRefsExt"), [listStaticDeltaIndexes]("GI.OSTree.Objects.Repo#g:method:listStaticDeltaIndexes"), [listStaticDeltaNames]("GI.OSTree.Objects.Repo#g:method:listStaticDeltaNames"), [loadCommit]("GI.OSTree.Objects.Repo#g:method:loadCommit"), [loadFile]("GI.OSTree.Objects.Repo#g:method:loadFile"), [loadObjectStream]("GI.OSTree.Objects.Repo#g:method:loadObjectStream"), [loadVariant]("GI.OSTree.Objects.Repo#g:method:loadVariant"), [loadVariantIfExists]("GI.OSTree.Objects.Repo#g:method:loadVariantIfExists"), [lockPop]("GI.OSTree.Objects.Repo#g:method:lockPop"), [lockPush]("GI.OSTree.Objects.Repo#g:method:lockPush"), [markCommitPartial]("GI.OSTree.Objects.Repo#g:method:markCommitPartial"), [markCommitPartialReason]("GI.OSTree.Objects.Repo#g:method:markCommitPartialReason"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [open]("GI.OSTree.Objects.Repo#g:method:open"), [prepareTransaction]("GI.OSTree.Objects.Repo#g:method:prepareTransaction"), [prune]("GI.OSTree.Objects.Repo#g:method:prune"), [pruneFromReachable]("GI.OSTree.Objects.Repo#g:method:pruneFromReachable"), [pruneStaticDeltas]("GI.OSTree.Objects.Repo#g:method:pruneStaticDeltas"), [pull]("GI.OSTree.Objects.Repo#g:method:pull"), [pullFromRemotesAsync]("GI.OSTree.Objects.Repo#g:method:pullFromRemotesAsync"), [pullFromRemotesFinish]("GI.OSTree.Objects.Repo#g:method:pullFromRemotesFinish"), [pullOneDir]("GI.OSTree.Objects.Repo#g:method:pullOneDir"), [pullWithOptions]("GI.OSTree.Objects.Repo#g:method:pullWithOptions"), [queryObjectStorageSize]("GI.OSTree.Objects.Repo#g:method:queryObjectStorageSize"), [readCommit]("GI.OSTree.Objects.Repo#g:method:readCommit"), [readCommitDetachedMetadata]("GI.OSTree.Objects.Repo#g:method:readCommitDetachedMetadata"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [regenerateMetadata]("GI.OSTree.Objects.Repo#g:method:regenerateMetadata"), [regenerateSummary]("GI.OSTree.Objects.Repo#g:method:regenerateSummary"), [reloadConfig]("GI.OSTree.Objects.Repo#g:method:reloadConfig"), [remoteAdd]("GI.OSTree.Objects.Repo#g:method:remoteAdd"), [remoteChange]("GI.OSTree.Objects.Repo#g:method:remoteChange"), [remoteDelete]("GI.OSTree.Objects.Repo#g:method:remoteDelete"), [remoteFetchSummary]("GI.OSTree.Objects.Repo#g:method:remoteFetchSummary"), [remoteFetchSummaryWithOptions]("GI.OSTree.Objects.Repo#g:method:remoteFetchSummaryWithOptions"), [remoteGetGpgKeys]("GI.OSTree.Objects.Repo#g:method:remoteGetGpgKeys"), [remoteGetGpgVerify]("GI.OSTree.Objects.Repo#g:method:remoteGetGpgVerify"), [remoteGetGpgVerifySummary]("GI.OSTree.Objects.Repo#g:method:remoteGetGpgVerifySummary"), [remoteGetUrl]("GI.OSTree.Objects.Repo#g:method:remoteGetUrl"), [remoteGpgImport]("GI.OSTree.Objects.Repo#g:method:remoteGpgImport"), [remoteList]("GI.OSTree.Objects.Repo#g:method:remoteList"), [remoteListCollectionRefs]("GI.OSTree.Objects.Repo#g:method:remoteListCollectionRefs"), [remoteListRefs]("GI.OSTree.Objects.Repo#g:method:remoteListRefs"), [resolveCollectionRef]("GI.OSTree.Objects.Repo#g:method:resolveCollectionRef"), [resolveKeyringForCollection]("GI.OSTree.Objects.Repo#g:method:resolveKeyringForCollection"), [resolveRev]("GI.OSTree.Objects.Repo#g:method:resolveRev"), [resolveRevExt]("GI.OSTree.Objects.Repo#g:method:resolveRevExt"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [scanHardlinks]("GI.OSTree.Objects.Repo#g:method:scanHardlinks"), [signCommit]("GI.OSTree.Objects.Repo#g:method:signCommit"), [signDelta]("GI.OSTree.Objects.Repo#g:method:signDelta"), [signatureVerifyCommitData]("GI.OSTree.Objects.Repo#g:method:signatureVerifyCommitData"), [staticDeltaExecuteOffline]("GI.OSTree.Objects.Repo#g:method:staticDeltaExecuteOffline"), [staticDeltaExecuteOfflineWithSignature]("GI.OSTree.Objects.Repo#g:method:staticDeltaExecuteOfflineWithSignature"), [staticDeltaGenerate]("GI.OSTree.Objects.Repo#g:method:staticDeltaGenerate"), [staticDeltaReindex]("GI.OSTree.Objects.Repo#g:method:staticDeltaReindex"), [staticDeltaVerifySignature]("GI.OSTree.Objects.Repo#g:method:staticDeltaVerifySignature"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [transactionSetCollectionRef]("GI.OSTree.Objects.Repo#g:method:transactionSetCollectionRef"), [transactionSetRef]("GI.OSTree.Objects.Repo#g:method:transactionSetRef"), [transactionSetRefspec]("GI.OSTree.Objects.Repo#g:method:transactionSetRefspec"), [traverseCommit]("GI.OSTree.Objects.Repo#g:method:traverseCommit"), [traverseReachableRefs]("GI.OSTree.Objects.Repo#g:method:traverseReachableRefs"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [verifyCommit]("GI.OSTree.Objects.Repo#g:method:verifyCommit"), [verifyCommitExt]("GI.OSTree.Objects.Repo#g:method:verifyCommitExt"), [verifyCommitForRemote]("GI.OSTree.Objects.Repo#g:method:verifyCommitForRemote"), [verifySummary]("GI.OSTree.Objects.Repo#g:method:verifySummary"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure"), [writeArchiveToMtree]("GI.OSTree.Objects.Repo#g:method:writeArchiveToMtree"), [writeArchiveToMtreeFromFd]("GI.OSTree.Objects.Repo#g:method:writeArchiveToMtreeFromFd"), [writeCommit]("GI.OSTree.Objects.Repo#g:method:writeCommit"), [writeCommitDetachedMetadata]("GI.OSTree.Objects.Repo#g:method:writeCommitDetachedMetadata"), [writeCommitWithTime]("GI.OSTree.Objects.Repo#g:method:writeCommitWithTime"), [writeConfig]("GI.OSTree.Objects.Repo#g:method:writeConfig"), [writeConfigAndReload]("GI.OSTree.Objects.Repo#g:method:writeConfigAndReload"), [writeContent]("GI.OSTree.Objects.Repo#g:method:writeContent"), [writeContentAsync]("GI.OSTree.Objects.Repo#g:method:writeContentAsync"), [writeContentFinish]("GI.OSTree.Objects.Repo#g:method:writeContentFinish"), [writeContentTrusted]("GI.OSTree.Objects.Repo#g:method:writeContentTrusted"), [writeDfdToMtree]("GI.OSTree.Objects.Repo#g:method:writeDfdToMtree"), [writeDirectoryToMtree]("GI.OSTree.Objects.Repo#g:method:writeDirectoryToMtree"), [writeMetadata]("GI.OSTree.Objects.Repo#g:method:writeMetadata"), [writeMetadataAsync]("GI.OSTree.Objects.Repo#g:method:writeMetadataAsync"), [writeMetadataFinish]("GI.OSTree.Objects.Repo#g:method:writeMetadataFinish"), [writeMetadataStreamTrusted]("GI.OSTree.Objects.Repo#g:method:writeMetadataStreamTrusted"), [writeMetadataTrusted]("GI.OSTree.Objects.Repo#g:method:writeMetadataTrusted"), [writeMtree]("GI.OSTree.Objects.Repo#g:method:writeMtree"), [writeRegfile]("GI.OSTree.Objects.Repo#g:method:writeRegfile"), [writeRegfileInline]("GI.OSTree.Objects.Repo#g:method:writeRegfileInline"), [writeSymlink]("GI.OSTree.Objects.Repo#g:method:writeSymlink").
-- 
-- ==== Getters
-- [getBootloader]("GI.OSTree.Objects.Repo#g:method:getBootloader"), [getCollectionId]("GI.OSTree.Objects.Repo#g:method:getCollectionId"), [getConfig]("GI.OSTree.Objects.Repo#g:method:getConfig"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDefaultRepoFinders]("GI.OSTree.Objects.Repo#g:method:getDefaultRepoFinders"), [getDfd]("GI.OSTree.Objects.Repo#g:method:getDfd"), [getDisableFsync]("GI.OSTree.Objects.Repo#g:method:getDisableFsync"), [getMinFreeSpaceBytes]("GI.OSTree.Objects.Repo#g:method:getMinFreeSpaceBytes"), [getMode]("GI.OSTree.Objects.Repo#g:method:getMode"), [getParent]("GI.OSTree.Objects.Repo#g:method:getParent"), [getPath]("GI.OSTree.Objects.Repo#g:method:getPath"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getRemoteBooleanOption]("GI.OSTree.Objects.Repo#g:method:getRemoteBooleanOption"), [getRemoteListOption]("GI.OSTree.Objects.Repo#g:method:getRemoteListOption"), [getRemoteOption]("GI.OSTree.Objects.Repo#g:method:getRemoteOption").
-- 
-- ==== Setters
-- [setAliasRefImmediate]("GI.OSTree.Objects.Repo#g:method:setAliasRefImmediate"), [setCacheDir]("GI.OSTree.Objects.Repo#g:method:setCacheDir"), [setCollectionId]("GI.OSTree.Objects.Repo#g:method:setCollectionId"), [setCollectionRefImmediate]("GI.OSTree.Objects.Repo#g:method:setCollectionRefImmediate"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setDisableFsync]("GI.OSTree.Objects.Repo#g:method:setDisableFsync"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setRefImmediate]("GI.OSTree.Objects.Repo#g:method:setRefImmediate").

#if defined(ENABLE_OVERLOADING)
    ResolveRepoMethod                       ,
#endif

-- ** abortTransaction #method:abortTransaction#

#if defined(ENABLE_OVERLOADING)
    RepoAbortTransactionMethodInfo          ,
#endif
    repoAbortTransaction                    ,


-- ** addGpgSignatureSummary #method:addGpgSignatureSummary#

#if defined(ENABLE_OVERLOADING)
    RepoAddGpgSignatureSummaryMethodInfo    ,
#endif
    repoAddGpgSignatureSummary              ,


-- ** appendGpgSignature #method:appendGpgSignature#

#if defined(ENABLE_OVERLOADING)
    RepoAppendGpgSignatureMethodInfo        ,
#endif
    repoAppendGpgSignature                  ,


-- ** checkoutAt #method:checkoutAt#

#if defined(ENABLE_OVERLOADING)
    RepoCheckoutAtMethodInfo                ,
#endif
    repoCheckoutAt                          ,


-- ** checkoutComposefs #method:checkoutComposefs#

#if defined(ENABLE_OVERLOADING)
    RepoCheckoutComposefsMethodInfo         ,
#endif
    repoCheckoutComposefs                   ,


-- ** checkoutGc #method:checkoutGc#

#if defined(ENABLE_OVERLOADING)
    RepoCheckoutGcMethodInfo                ,
#endif
    repoCheckoutGc                          ,


-- ** checkoutTree #method:checkoutTree#

#if defined(ENABLE_OVERLOADING)
    RepoCheckoutTreeMethodInfo              ,
#endif
    repoCheckoutTree                        ,


-- ** commitAddComposefsMetadata #method:commitAddComposefsMetadata#

#if defined(ENABLE_OVERLOADING)
    RepoCommitAddComposefsMetadataMethodInfo,
#endif
    repoCommitAddComposefsMetadata          ,


-- ** commitTransaction #method:commitTransaction#

#if defined(ENABLE_OVERLOADING)
    RepoCommitTransactionMethodInfo         ,
#endif
    repoCommitTransaction                   ,


-- ** copyConfig #method:copyConfig#

#if defined(ENABLE_OVERLOADING)
    RepoCopyConfigMethodInfo                ,
#endif
    repoCopyConfig                          ,


-- ** create #method:create#

#if defined(ENABLE_OVERLOADING)
    RepoCreateMethodInfo                    ,
#endif
    repoCreate                              ,


-- ** createAt #method:createAt#

    repoCreateAt                            ,


-- ** deleteObject #method:deleteObject#

#if defined(ENABLE_OVERLOADING)
    RepoDeleteObjectMethodInfo              ,
#endif
    repoDeleteObject                        ,


-- ** equal #method:equal#

#if defined(ENABLE_OVERLOADING)
    RepoEqualMethodInfo                     ,
#endif
    repoEqual                               ,


-- ** findRemotesAsync #method:findRemotesAsync#

#if defined(ENABLE_OVERLOADING)
    RepoFindRemotesAsyncMethodInfo          ,
#endif
    repoFindRemotesAsync                    ,


-- ** findRemotesFinish #method:findRemotesFinish#

#if defined(ENABLE_OVERLOADING)
    RepoFindRemotesFinishMethodInfo         ,
#endif
    repoFindRemotesFinish                   ,


-- ** fsckObject #method:fsckObject#

#if defined(ENABLE_OVERLOADING)
    RepoFsckObjectMethodInfo                ,
#endif
    repoFsckObject                          ,


-- ** getBootloader #method:getBootloader#

#if defined(ENABLE_OVERLOADING)
    RepoGetBootloaderMethodInfo             ,
#endif
    repoGetBootloader                       ,


-- ** getCollectionId #method:getCollectionId#

#if defined(ENABLE_OVERLOADING)
    RepoGetCollectionIdMethodInfo           ,
#endif
    repoGetCollectionId                     ,


-- ** getConfig #method:getConfig#

#if defined(ENABLE_OVERLOADING)
    RepoGetConfigMethodInfo                 ,
#endif
    repoGetConfig                           ,


-- ** getDefaultRepoFinders #method:getDefaultRepoFinders#

#if defined(ENABLE_OVERLOADING)
    RepoGetDefaultRepoFindersMethodInfo     ,
#endif
    repoGetDefaultRepoFinders               ,


-- ** getDfd #method:getDfd#

#if defined(ENABLE_OVERLOADING)
    RepoGetDfdMethodInfo                    ,
#endif
    repoGetDfd                              ,


-- ** getDisableFsync #method:getDisableFsync#

#if defined(ENABLE_OVERLOADING)
    RepoGetDisableFsyncMethodInfo           ,
#endif
    repoGetDisableFsync                     ,


-- ** getMinFreeSpaceBytes #method:getMinFreeSpaceBytes#

#if defined(ENABLE_OVERLOADING)
    RepoGetMinFreeSpaceBytesMethodInfo      ,
#endif
    repoGetMinFreeSpaceBytes                ,


-- ** getMode #method:getMode#

#if defined(ENABLE_OVERLOADING)
    RepoGetModeMethodInfo                   ,
#endif
    repoGetMode                             ,


-- ** getParent #method:getParent#

#if defined(ENABLE_OVERLOADING)
    RepoGetParentMethodInfo                 ,
#endif
    repoGetParent                           ,


-- ** getPath #method:getPath#

#if defined(ENABLE_OVERLOADING)
    RepoGetPathMethodInfo                   ,
#endif
    repoGetPath                             ,


-- ** getRemoteBooleanOption #method:getRemoteBooleanOption#

#if defined(ENABLE_OVERLOADING)
    RepoGetRemoteBooleanOptionMethodInfo    ,
#endif
    repoGetRemoteBooleanOption              ,


-- ** getRemoteListOption #method:getRemoteListOption#

#if defined(ENABLE_OVERLOADING)
    RepoGetRemoteListOptionMethodInfo       ,
#endif
    repoGetRemoteListOption                 ,


-- ** getRemoteOption #method:getRemoteOption#

#if defined(ENABLE_OVERLOADING)
    RepoGetRemoteOptionMethodInfo           ,
#endif
    repoGetRemoteOption                     ,


-- ** gpgSignData #method:gpgSignData#

#if defined(ENABLE_OVERLOADING)
    RepoGpgSignDataMethodInfo               ,
#endif
    repoGpgSignData                         ,


-- ** gpgVerifyData #method:gpgVerifyData#

#if defined(ENABLE_OVERLOADING)
    RepoGpgVerifyDataMethodInfo             ,
#endif
    repoGpgVerifyData                       ,


-- ** hasObject #method:hasObject#

#if defined(ENABLE_OVERLOADING)
    RepoHasObjectMethodInfo                 ,
#endif
    repoHasObject                           ,


-- ** hash #method:hash#

#if defined(ENABLE_OVERLOADING)
    RepoHashMethodInfo                      ,
#endif
    repoHash                                ,


-- ** importObjectFrom #method:importObjectFrom#

#if defined(ENABLE_OVERLOADING)
    RepoImportObjectFromMethodInfo          ,
#endif
    repoImportObjectFrom                    ,


-- ** importObjectFromWithTrust #method:importObjectFromWithTrust#

#if defined(ENABLE_OVERLOADING)
    RepoImportObjectFromWithTrustMethodInfo ,
#endif
    repoImportObjectFromWithTrust           ,


-- ** isSystem #method:isSystem#

#if defined(ENABLE_OVERLOADING)
    RepoIsSystemMethodInfo                  ,
#endif
    repoIsSystem                            ,


-- ** isWritable #method:isWritable#

#if defined(ENABLE_OVERLOADING)
    RepoIsWritableMethodInfo                ,
#endif
    repoIsWritable                          ,


-- ** listStaticDeltaIndexes #method:listStaticDeltaIndexes#

#if defined(ENABLE_OVERLOADING)
    RepoListStaticDeltaIndexesMethodInfo    ,
#endif
    repoListStaticDeltaIndexes              ,


-- ** listStaticDeltaNames #method:listStaticDeltaNames#

#if defined(ENABLE_OVERLOADING)
    RepoListStaticDeltaNamesMethodInfo      ,
#endif
    repoListStaticDeltaNames                ,


-- ** loadCommit #method:loadCommit#

#if defined(ENABLE_OVERLOADING)
    RepoLoadCommitMethodInfo                ,
#endif
    repoLoadCommit                          ,


-- ** loadFile #method:loadFile#

#if defined(ENABLE_OVERLOADING)
    RepoLoadFileMethodInfo                  ,
#endif
    repoLoadFile                            ,


-- ** loadObjectStream #method:loadObjectStream#

#if defined(ENABLE_OVERLOADING)
    RepoLoadObjectStreamMethodInfo          ,
#endif
    repoLoadObjectStream                    ,


-- ** loadVariant #method:loadVariant#

#if defined(ENABLE_OVERLOADING)
    RepoLoadVariantMethodInfo               ,
#endif
    repoLoadVariant                         ,


-- ** loadVariantIfExists #method:loadVariantIfExists#

#if defined(ENABLE_OVERLOADING)
    RepoLoadVariantIfExistsMethodInfo       ,
#endif
    repoLoadVariantIfExists                 ,


-- ** lockPop #method:lockPop#

#if defined(ENABLE_OVERLOADING)
    RepoLockPopMethodInfo                   ,
#endif
    repoLockPop                             ,


-- ** lockPush #method:lockPush#

#if defined(ENABLE_OVERLOADING)
    RepoLockPushMethodInfo                  ,
#endif
    repoLockPush                            ,


-- ** markCommitPartial #method:markCommitPartial#

#if defined(ENABLE_OVERLOADING)
    RepoMarkCommitPartialMethodInfo         ,
#endif
    repoMarkCommitPartial                   ,


-- ** markCommitPartialReason #method:markCommitPartialReason#

#if defined(ENABLE_OVERLOADING)
    RepoMarkCommitPartialReasonMethodInfo   ,
#endif
    repoMarkCommitPartialReason             ,


-- ** modeFromString #method:modeFromString#

    repoModeFromString                      ,


-- ** new #method:new#

    repoNew                                 ,


-- ** newDefault #method:newDefault#

    repoNewDefault                          ,


-- ** newForSysrootPath #method:newForSysrootPath#

    repoNewForSysrootPath                   ,


-- ** open #method:open#

#if defined(ENABLE_OVERLOADING)
    RepoOpenMethodInfo                      ,
#endif
    repoOpen                                ,


-- ** openAt #method:openAt#

    repoOpenAt                              ,


-- ** prepareTransaction #method:prepareTransaction#

#if defined(ENABLE_OVERLOADING)
    RepoPrepareTransactionMethodInfo        ,
#endif
    repoPrepareTransaction                  ,


-- ** prune #method:prune#

#if defined(ENABLE_OVERLOADING)
    RepoPruneMethodInfo                     ,
#endif
    repoPrune                               ,


-- ** pruneFromReachable #method:pruneFromReachable#

#if defined(ENABLE_OVERLOADING)
    RepoPruneFromReachableMethodInfo        ,
#endif
    repoPruneFromReachable                  ,


-- ** pruneStaticDeltas #method:pruneStaticDeltas#

#if defined(ENABLE_OVERLOADING)
    RepoPruneStaticDeltasMethodInfo         ,
#endif
    repoPruneStaticDeltas                   ,


-- ** pull #method:pull#

#if defined(ENABLE_OVERLOADING)
    RepoPullMethodInfo                      ,
#endif
    repoPull                                ,


-- ** pullDefaultConsoleProgressChanged #method:pullDefaultConsoleProgressChanged#

    repoPullDefaultConsoleProgressChanged   ,


-- ** pullFromRemotesAsync #method:pullFromRemotesAsync#

#if defined(ENABLE_OVERLOADING)
    RepoPullFromRemotesAsyncMethodInfo      ,
#endif
    repoPullFromRemotesAsync                ,


-- ** pullFromRemotesFinish #method:pullFromRemotesFinish#

#if defined(ENABLE_OVERLOADING)
    RepoPullFromRemotesFinishMethodInfo     ,
#endif
    repoPullFromRemotesFinish               ,


-- ** pullOneDir #method:pullOneDir#

#if defined(ENABLE_OVERLOADING)
    RepoPullOneDirMethodInfo                ,
#endif
    repoPullOneDir                          ,


-- ** pullWithOptions #method:pullWithOptions#

#if defined(ENABLE_OVERLOADING)
    RepoPullWithOptionsMethodInfo           ,
#endif
    repoPullWithOptions                     ,


-- ** queryObjectStorageSize #method:queryObjectStorageSize#

#if defined(ENABLE_OVERLOADING)
    RepoQueryObjectStorageSizeMethodInfo    ,
#endif
    repoQueryObjectStorageSize              ,


-- ** readCommit #method:readCommit#

#if defined(ENABLE_OVERLOADING)
    RepoReadCommitMethodInfo                ,
#endif
    repoReadCommit                          ,


-- ** readCommitDetachedMetadata #method:readCommitDetachedMetadata#

#if defined(ENABLE_OVERLOADING)
    RepoReadCommitDetachedMetadataMethodInfo,
#endif
    repoReadCommitDetachedMetadata          ,


-- ** regenerateMetadata #method:regenerateMetadata#

#if defined(ENABLE_OVERLOADING)
    RepoRegenerateMetadataMethodInfo        ,
#endif
    repoRegenerateMetadata                  ,


-- ** regenerateSummary #method:regenerateSummary#

#if defined(ENABLE_OVERLOADING)
    RepoRegenerateSummaryMethodInfo         ,
#endif
    repoRegenerateSummary                   ,


-- ** reloadConfig #method:reloadConfig#

#if defined(ENABLE_OVERLOADING)
    RepoReloadConfigMethodInfo              ,
#endif
    repoReloadConfig                        ,


-- ** remoteAdd #method:remoteAdd#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteAddMethodInfo                 ,
#endif
    repoRemoteAdd                           ,


-- ** remoteChange #method:remoteChange#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteChangeMethodInfo              ,
#endif
    repoRemoteChange                        ,


-- ** remoteDelete #method:remoteDelete#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteDeleteMethodInfo              ,
#endif
    repoRemoteDelete                        ,


-- ** remoteFetchSummary #method:remoteFetchSummary#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteFetchSummaryMethodInfo        ,
#endif
    repoRemoteFetchSummary                  ,


-- ** remoteFetchSummaryWithOptions #method:remoteFetchSummaryWithOptions#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteFetchSummaryWithOptionsMethodInfo,
#endif
    repoRemoteFetchSummaryWithOptions       ,


-- ** remoteGetGpgKeys #method:remoteGetGpgKeys#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteGetGpgKeysMethodInfo          ,
#endif
    repoRemoteGetGpgKeys                    ,


-- ** remoteGetGpgVerify #method:remoteGetGpgVerify#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteGetGpgVerifyMethodInfo        ,
#endif
    repoRemoteGetGpgVerify                  ,


-- ** remoteGetGpgVerifySummary #method:remoteGetGpgVerifySummary#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteGetGpgVerifySummaryMethodInfo ,
#endif
    repoRemoteGetGpgVerifySummary           ,


-- ** remoteGetUrl #method:remoteGetUrl#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteGetUrlMethodInfo              ,
#endif
    repoRemoteGetUrl                        ,


-- ** remoteGpgImport #method:remoteGpgImport#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteGpgImportMethodInfo           ,
#endif
    repoRemoteGpgImport                     ,


-- ** remoteList #method:remoteList#

#if defined(ENABLE_OVERLOADING)
    RepoRemoteListMethodInfo                ,
#endif
    repoRemoteList                          ,


-- ** resolveCollectionRef #method:resolveCollectionRef#

#if defined(ENABLE_OVERLOADING)
    RepoResolveCollectionRefMethodInfo      ,
#endif
    repoResolveCollectionRef                ,


-- ** resolveKeyringForCollection #method:resolveKeyringForCollection#

#if defined(ENABLE_OVERLOADING)
    RepoResolveKeyringForCollectionMethodInfo,
#endif
    repoResolveKeyringForCollection         ,


-- ** resolveRev #method:resolveRev#

#if defined(ENABLE_OVERLOADING)
    RepoResolveRevMethodInfo                ,
#endif
    repoResolveRev                          ,


-- ** resolveRevExt #method:resolveRevExt#

#if defined(ENABLE_OVERLOADING)
    RepoResolveRevExtMethodInfo             ,
#endif
    repoResolveRevExt                       ,


-- ** scanHardlinks #method:scanHardlinks#

#if defined(ENABLE_OVERLOADING)
    RepoScanHardlinksMethodInfo             ,
#endif
    repoScanHardlinks                       ,


-- ** setAliasRefImmediate #method:setAliasRefImmediate#

#if defined(ENABLE_OVERLOADING)
    RepoSetAliasRefImmediateMethodInfo      ,
#endif
    repoSetAliasRefImmediate                ,


-- ** setCacheDir #method:setCacheDir#

#if defined(ENABLE_OVERLOADING)
    RepoSetCacheDirMethodInfo               ,
#endif
    repoSetCacheDir                         ,


-- ** setCollectionId #method:setCollectionId#

#if defined(ENABLE_OVERLOADING)
    RepoSetCollectionIdMethodInfo           ,
#endif
    repoSetCollectionId                     ,


-- ** setCollectionRefImmediate #method:setCollectionRefImmediate#

#if defined(ENABLE_OVERLOADING)
    RepoSetCollectionRefImmediateMethodInfo ,
#endif
    repoSetCollectionRefImmediate           ,


-- ** setDisableFsync #method:setDisableFsync#

#if defined(ENABLE_OVERLOADING)
    RepoSetDisableFsyncMethodInfo           ,
#endif
    repoSetDisableFsync                     ,


-- ** setRefImmediate #method:setRefImmediate#

#if defined(ENABLE_OVERLOADING)
    RepoSetRefImmediateMethodInfo           ,
#endif
    repoSetRefImmediate                     ,


-- ** signCommit #method:signCommit#

#if defined(ENABLE_OVERLOADING)
    RepoSignCommitMethodInfo                ,
#endif
    repoSignCommit                          ,


-- ** signDelta #method:signDelta#

#if defined(ENABLE_OVERLOADING)
    RepoSignDeltaMethodInfo                 ,
#endif
    repoSignDelta                           ,


-- ** signatureVerifyCommitData #method:signatureVerifyCommitData#

#if defined(ENABLE_OVERLOADING)
    RepoSignatureVerifyCommitDataMethodInfo ,
#endif
    repoSignatureVerifyCommitData           ,


-- ** staticDeltaExecuteOffline #method:staticDeltaExecuteOffline#

#if defined(ENABLE_OVERLOADING)
    RepoStaticDeltaExecuteOfflineMethodInfo ,
#endif
    repoStaticDeltaExecuteOffline           ,


-- ** staticDeltaExecuteOfflineWithSignature #method:staticDeltaExecuteOfflineWithSignature#

#if defined(ENABLE_OVERLOADING)
    RepoStaticDeltaExecuteOfflineWithSignatureMethodInfo,
#endif
    repoStaticDeltaExecuteOfflineWithSignature,


-- ** staticDeltaGenerate #method:staticDeltaGenerate#

#if defined(ENABLE_OVERLOADING)
    RepoStaticDeltaGenerateMethodInfo       ,
#endif
    repoStaticDeltaGenerate                 ,


-- ** staticDeltaReindex #method:staticDeltaReindex#

#if defined(ENABLE_OVERLOADING)
    RepoStaticDeltaReindexMethodInfo        ,
#endif
    repoStaticDeltaReindex                  ,


-- ** staticDeltaVerifySignature #method:staticDeltaVerifySignature#

#if defined(ENABLE_OVERLOADING)
    RepoStaticDeltaVerifySignatureMethodInfo,
#endif
    repoStaticDeltaVerifySignature          ,


-- ** transactionSetCollectionRef #method:transactionSetCollectionRef#

#if defined(ENABLE_OVERLOADING)
    RepoTransactionSetCollectionRefMethodInfo,
#endif
    repoTransactionSetCollectionRef         ,


-- ** transactionSetRef #method:transactionSetRef#

#if defined(ENABLE_OVERLOADING)
    RepoTransactionSetRefMethodInfo         ,
#endif
    repoTransactionSetRef                   ,


-- ** transactionSetRefspec #method:transactionSetRefspec#

#if defined(ENABLE_OVERLOADING)
    RepoTransactionSetRefspecMethodInfo     ,
#endif
    repoTransactionSetRefspec               ,


-- ** traverseParentsGetCommits #method:traverseParentsGetCommits#

    repoTraverseParentsGetCommits           ,


-- ** verifyCommit #method:verifyCommit#

#if defined(ENABLE_OVERLOADING)
    RepoVerifyCommitMethodInfo              ,
#endif
    repoVerifyCommit                        ,


-- ** verifyCommitExt #method:verifyCommitExt#

#if defined(ENABLE_OVERLOADING)
    RepoVerifyCommitExtMethodInfo           ,
#endif
    repoVerifyCommitExt                     ,


-- ** verifyCommitForRemote #method:verifyCommitForRemote#

#if defined(ENABLE_OVERLOADING)
    RepoVerifyCommitForRemoteMethodInfo     ,
#endif
    repoVerifyCommitForRemote               ,


-- ** verifySummary #method:verifySummary#

#if defined(ENABLE_OVERLOADING)
    RepoVerifySummaryMethodInfo             ,
#endif
    repoVerifySummary                       ,


-- ** writeArchiveToMtree #method:writeArchiveToMtree#

#if defined(ENABLE_OVERLOADING)
    RepoWriteArchiveToMtreeMethodInfo       ,
#endif
    repoWriteArchiveToMtree                 ,


-- ** writeArchiveToMtreeFromFd #method:writeArchiveToMtreeFromFd#

#if defined(ENABLE_OVERLOADING)
    RepoWriteArchiveToMtreeFromFdMethodInfo ,
#endif
    repoWriteArchiveToMtreeFromFd           ,


-- ** writeCommit #method:writeCommit#

#if defined(ENABLE_OVERLOADING)
    RepoWriteCommitMethodInfo               ,
#endif
    repoWriteCommit                         ,


-- ** writeCommitDetachedMetadata #method:writeCommitDetachedMetadata#

#if defined(ENABLE_OVERLOADING)
    RepoWriteCommitDetachedMetadataMethodInfo,
#endif
    repoWriteCommitDetachedMetadata         ,


-- ** writeCommitWithTime #method:writeCommitWithTime#

#if defined(ENABLE_OVERLOADING)
    RepoWriteCommitWithTimeMethodInfo       ,
#endif
    repoWriteCommitWithTime                 ,


-- ** writeConfig #method:writeConfig#

#if defined(ENABLE_OVERLOADING)
    RepoWriteConfigMethodInfo               ,
#endif
    repoWriteConfig                         ,


-- ** writeConfigAndReload #method:writeConfigAndReload#

#if defined(ENABLE_OVERLOADING)
    RepoWriteConfigAndReloadMethodInfo      ,
#endif
    repoWriteConfigAndReload                ,


-- ** writeContent #method:writeContent#

#if defined(ENABLE_OVERLOADING)
    RepoWriteContentMethodInfo              ,
#endif
    repoWriteContent                        ,


-- ** writeContentAsync #method:writeContentAsync#

#if defined(ENABLE_OVERLOADING)
    RepoWriteContentAsyncMethodInfo         ,
#endif
    repoWriteContentAsync                   ,


-- ** writeContentFinish #method:writeContentFinish#

#if defined(ENABLE_OVERLOADING)
    RepoWriteContentFinishMethodInfo        ,
#endif
    repoWriteContentFinish                  ,


-- ** writeContentTrusted #method:writeContentTrusted#

#if defined(ENABLE_OVERLOADING)
    RepoWriteContentTrustedMethodInfo       ,
#endif
    repoWriteContentTrusted                 ,


-- ** writeDfdToMtree #method:writeDfdToMtree#

#if defined(ENABLE_OVERLOADING)
    RepoWriteDfdToMtreeMethodInfo           ,
#endif
    repoWriteDfdToMtree                     ,


-- ** writeDirectoryToMtree #method:writeDirectoryToMtree#

#if defined(ENABLE_OVERLOADING)
    RepoWriteDirectoryToMtreeMethodInfo     ,
#endif
    repoWriteDirectoryToMtree               ,


-- ** writeMetadata #method:writeMetadata#

#if defined(ENABLE_OVERLOADING)
    RepoWriteMetadataMethodInfo             ,
#endif
    repoWriteMetadata                       ,


-- ** writeMetadataAsync #method:writeMetadataAsync#

#if defined(ENABLE_OVERLOADING)
    RepoWriteMetadataAsyncMethodInfo        ,
#endif
    repoWriteMetadataAsync                  ,


-- ** writeMetadataFinish #method:writeMetadataFinish#

#if defined(ENABLE_OVERLOADING)
    RepoWriteMetadataFinishMethodInfo       ,
#endif
    repoWriteMetadataFinish                 ,


-- ** writeMetadataStreamTrusted #method:writeMetadataStreamTrusted#

#if defined(ENABLE_OVERLOADING)
    RepoWriteMetadataStreamTrustedMethodInfo,
#endif
    repoWriteMetadataStreamTrusted          ,


-- ** writeMetadataTrusted #method:writeMetadataTrusted#

#if defined(ENABLE_OVERLOADING)
    RepoWriteMetadataTrustedMethodInfo      ,
#endif
    repoWriteMetadataTrusted                ,


-- ** writeMtree #method:writeMtree#

#if defined(ENABLE_OVERLOADING)
    RepoWriteMtreeMethodInfo                ,
#endif
    repoWriteMtree                          ,


-- ** writeRegfile #method:writeRegfile#

#if defined(ENABLE_OVERLOADING)
    RepoWriteRegfileMethodInfo              ,
#endif
    repoWriteRegfile                        ,


-- ** writeRegfileInline #method:writeRegfileInline#

#if defined(ENABLE_OVERLOADING)
    RepoWriteRegfileInlineMethodInfo        ,
#endif
    repoWriteRegfileInline                  ,


-- ** writeSymlink #method:writeSymlink#

#if defined(ENABLE_OVERLOADING)
    RepoWriteSymlinkMethodInfo              ,
#endif
    repoWriteSymlink                        ,




 -- * Properties


-- ** path #attr:path#
-- | Path to repository.  Note that if this repository was created
-- via @ostree_repo_new_at()@, this value will refer to a value in
-- the Linux kernel\'s @\/proc\/self\/fd@ directory.  Generally, you
-- should avoid using this property at all; you can gain a reference
-- to the repository\'s directory fd via @ostree_repo_get_dfd()@ and
-- use file-descriptor relative operations.

#if defined(ENABLE_OVERLOADING)
    RepoPathPropertyInfo                    ,
#endif
    constructRepoPath                       ,
    getRepoPath                             ,
#if defined(ENABLE_OVERLOADING)
    repoPath                                ,
#endif


-- ** remotesConfigDir #attr:remotesConfigDir#
-- | Path to directory containing remote definitions.  The default is @NULL@.
-- If a @sysroot-path@ property is defined, this value will default to
-- @${sysroot_path}\/etc\/ostree\/remotes.d@.
-- 
-- This value will only be used for system repositories.

#if defined(ENABLE_OVERLOADING)
    RepoRemotesConfigDirPropertyInfo        ,
#endif
    constructRepoRemotesConfigDir           ,
    getRepoRemotesConfigDir                 ,
#if defined(ENABLE_OVERLOADING)
    repoRemotesConfigDir                    ,
#endif


-- ** sysrootPath #attr:sysrootPath#
-- | A system using libostree for the host has a \"system\" repository; this
-- property will be set for repositories referenced via
-- @ostree_sysroot_repo()@ for example.
-- 
-- You should avoid using this property; if your code is operating
-- on a system repository, use @OstreeSysroot@ and access the repository
-- object via @ostree_sysroot_repo()@.

#if defined(ENABLE_OVERLOADING)
    RepoSysrootPathPropertyInfo             ,
#endif
    constructRepoSysrootPath                ,
    getRepoSysrootPath                      ,
#if defined(ENABLE_OVERLOADING)
    repoSysrootPath                         ,
#endif




 -- * Signals


-- ** gpgVerifyResult #signal:gpgVerifyResult#

    RepoGpgVerifyResultCallback             ,
#if defined(ENABLE_OVERLOADING)
    RepoGpgVerifyResultSignalInfo           ,
#endif
    afterRepoGpgVerifyResult                ,
    onRepoGpgVerifyResult                   ,




    ) where

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

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

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
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 qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.OSTree.Callbacks as OSTree.Callbacks
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.BlobReader as OSTree.BlobReader
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.Sign as OSTree.Sign
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.ContentWriter as OSTree.ContentWriter
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.Objects.SePolicy as OSTree.SePolicy
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
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.RepoDevInoCache as OSTree.RepoDevInoCache
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats

#else
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict
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.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.Sign as OSTree.Sign
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.ContentWriter as OSTree.ContentWriter
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.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
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.RepoFinderResult as OSTree.RepoFinderResult
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats

#endif

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

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

foreign import ccall "ostree_repo_get_type"
    c_ostree_repo_get_type :: IO B.Types.GType

instance B.Types.TypedObject Repo where
    glibType :: IO GType
glibType = IO GType
c_ostree_repo_get_type

instance B.Types.GObject Repo

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

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

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveRepoMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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 "checkoutComposefs" o = RepoCheckoutComposefsMethodInfo
    ResolveRepoMethod "checkoutGc" o = RepoCheckoutGcMethodInfo
    ResolveRepoMethod "checkoutTree" o = RepoCheckoutTreeMethodInfo
    ResolveRepoMethod "commitAddComposefsMetadata" o = RepoCommitAddComposefsMetadataMethodInfo
    ResolveRepoMethod "commitTransaction" o = RepoCommitTransactionMethodInfo
    ResolveRepoMethod "copyConfig" o = RepoCopyConfigMethodInfo
    ResolveRepoMethod "create" o = RepoCreateMethodInfo
    ResolveRepoMethod "deleteObject" o = RepoDeleteObjectMethodInfo
    ResolveRepoMethod "equal" o = RepoEqualMethodInfo
    ResolveRepoMethod "findRemotesAsync" o = RepoFindRemotesAsyncMethodInfo
    ResolveRepoMethod "findRemotesFinish" o = RepoFindRemotesFinishMethodInfo
    ResolveRepoMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveRepoMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveRepoMethod "fsckObject" o = RepoFsckObjectMethodInfo
    ResolveRepoMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveRepoMethod "gpgSignData" o = RepoGpgSignDataMethodInfo
    ResolveRepoMethod "gpgVerifyData" o = RepoGpgVerifyDataMethodInfo
    ResolveRepoMethod "hasObject" o = RepoHasObjectMethodInfo
    ResolveRepoMethod "hash" o = RepoHashMethodInfo
    ResolveRepoMethod "importObjectFrom" o = RepoImportObjectFromMethodInfo
    ResolveRepoMethod "importObjectFromWithTrust" o = RepoImportObjectFromWithTrustMethodInfo
    ResolveRepoMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveRepoMethod "isSystem" o = RepoIsSystemMethodInfo
    ResolveRepoMethod "isWritable" o = RepoIsWritableMethodInfo
    ResolveRepoMethod "listCollectionRefs" o = RepoListCollectionRefsMethodInfo
    ResolveRepoMethod "listCommitObjectsStartingWith" o = RepoListCommitObjectsStartingWithMethodInfo
    ResolveRepoMethod "listObjects" o = RepoListObjectsMethodInfo
    ResolveRepoMethod "listRefs" o = RepoListRefsMethodInfo
    ResolveRepoMethod "listRefsExt" o = RepoListRefsExtMethodInfo
    ResolveRepoMethod "listStaticDeltaIndexes" o = RepoListStaticDeltaIndexesMethodInfo
    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 "lockPop" o = RepoLockPopMethodInfo
    ResolveRepoMethod "lockPush" o = RepoLockPushMethodInfo
    ResolveRepoMethod "markCommitPartial" o = RepoMarkCommitPartialMethodInfo
    ResolveRepoMethod "markCommitPartialReason" o = RepoMarkCommitPartialReasonMethodInfo
    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 "pullFromRemotesAsync" o = RepoPullFromRemotesAsyncMethodInfo
    ResolveRepoMethod "pullFromRemotesFinish" o = RepoPullFromRemotesFinishMethodInfo
    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 "regenerateMetadata" o = RepoRegenerateMetadataMethodInfo
    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 "remoteGetGpgKeys" o = RepoRemoteGetGpgKeysMethodInfo
    ResolveRepoMethod "remoteGetGpgVerify" o = RepoRemoteGetGpgVerifyMethodInfo
    ResolveRepoMethod "remoteGetGpgVerifySummary" o = RepoRemoteGetGpgVerifySummaryMethodInfo
    ResolveRepoMethod "remoteGetUrl" o = RepoRemoteGetUrlMethodInfo
    ResolveRepoMethod "remoteGpgImport" o = RepoRemoteGpgImportMethodInfo
    ResolveRepoMethod "remoteList" o = RepoRemoteListMethodInfo
    ResolveRepoMethod "remoteListCollectionRefs" o = RepoRemoteListCollectionRefsMethodInfo
    ResolveRepoMethod "remoteListRefs" o = RepoRemoteListRefsMethodInfo
    ResolveRepoMethod "resolveCollectionRef" o = RepoResolveCollectionRefMethodInfo
    ResolveRepoMethod "resolveKeyringForCollection" o = RepoResolveKeyringForCollectionMethodInfo
    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 "signatureVerifyCommitData" o = RepoSignatureVerifyCommitDataMethodInfo
    ResolveRepoMethod "staticDeltaExecuteOffline" o = RepoStaticDeltaExecuteOfflineMethodInfo
    ResolveRepoMethod "staticDeltaExecuteOfflineWithSignature" o = RepoStaticDeltaExecuteOfflineWithSignatureMethodInfo
    ResolveRepoMethod "staticDeltaGenerate" o = RepoStaticDeltaGenerateMethodInfo
    ResolveRepoMethod "staticDeltaReindex" o = RepoStaticDeltaReindexMethodInfo
    ResolveRepoMethod "staticDeltaVerifySignature" o = RepoStaticDeltaVerifySignatureMethodInfo
    ResolveRepoMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveRepoMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveRepoMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveRepoMethod "transactionSetCollectionRef" o = RepoTransactionSetCollectionRefMethodInfo
    ResolveRepoMethod "transactionSetRef" o = RepoTransactionSetRefMethodInfo
    ResolveRepoMethod "transactionSetRefspec" o = RepoTransactionSetRefspecMethodInfo
    ResolveRepoMethod "traverseCommit" o = RepoTraverseCommitMethodInfo
    ResolveRepoMethod "traverseReachableRefs" o = RepoTraverseReachableRefsMethodInfo
    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 "writeArchiveToMtreeFromFd" o = RepoWriteArchiveToMtreeFromFdMethodInfo
    ResolveRepoMethod "writeCommit" o = RepoWriteCommitMethodInfo
    ResolveRepoMethod "writeCommitDetachedMetadata" o = RepoWriteCommitDetachedMetadataMethodInfo
    ResolveRepoMethod "writeCommitWithTime" o = RepoWriteCommitWithTimeMethodInfo
    ResolveRepoMethod "writeConfig" o = RepoWriteConfigMethodInfo
    ResolveRepoMethod "writeConfigAndReload" o = RepoWriteConfigAndReloadMethodInfo
    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 "writeRegfile" o = RepoWriteRegfileMethodInfo
    ResolveRepoMethod "writeRegfileInline" o = RepoWriteRegfileInlineMethodInfo
    ResolveRepoMethod "writeSymlink" o = RepoWriteSymlinkMethodInfo
    ResolveRepoMethod "getBootloader" o = RepoGetBootloaderMethodInfo
    ResolveRepoMethod "getCollectionId" o = RepoGetCollectionIdMethodInfo
    ResolveRepoMethod "getConfig" o = RepoGetConfigMethodInfo
    ResolveRepoMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveRepoMethod "getDefaultRepoFinders" o = RepoGetDefaultRepoFindersMethodInfo
    ResolveRepoMethod "getDfd" o = RepoGetDfdMethodInfo
    ResolveRepoMethod "getDisableFsync" o = RepoGetDisableFsyncMethodInfo
    ResolveRepoMethod "getMinFreeSpaceBytes" o = RepoGetMinFreeSpaceBytesMethodInfo
    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 "setAliasRefImmediate" o = RepoSetAliasRefImmediateMethodInfo
    ResolveRepoMethod "setCacheDir" o = RepoSetCacheDirMethodInfo
    ResolveRepoMethod "setCollectionId" o = RepoSetCollectionIdMethodInfo
    ResolveRepoMethod "setCollectionRefImmediate" o = RepoSetCollectionRefImmediateMethodInfo
    ResolveRepoMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveRepoMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    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.OverloadedMethod info Repo p) => OL.IsLabel t (Repo -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveRepoMethod t Repo, O.OverloadedMethod info Repo p, R.HasField t Repo p) => R.HasField t Repo p where
    getField = O.overloadedMethod @info

#endif

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

#endif

-- signal Repo::gpg-verify-result
-- | Emitted during a pull operation upon GPG verification (if enabled).
-- Applications can connect to this signal to output the verification
-- results if desired.
-- 
-- The signal will be emitted from whichever t'GI.GLib.Structs.MainContext.MainContext' is the
-- thread-default at the point when 'GI.OSTree.Objects.Repo.repoPullWithOptions'
-- is called.
type RepoGpgVerifyResultCallback =
    T.Text
    -- ^ /@checksum@/: checksum of the signed object
    -> OSTree.GpgVerifyResult.GpgVerifyResult
    -- ^ /@result@/: an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'
    -> IO ()

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

-- | Generate a function pointer callable from C code, from a `C_RepoGpgVerifyResultCallback`.
foreign import ccall "wrapper"
    mk_RepoGpgVerifyResultCallback :: C_RepoGpgVerifyResultCallback -> IO (FunPtr C_RepoGpgVerifyResultCallback)

wrap_RepoGpgVerifyResultCallback :: 
    GObject a => (a -> RepoGpgVerifyResultCallback) ->
    C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback :: forall a.
GObject a =>
(a -> RepoGpgVerifyResultCallback) -> C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback a -> RepoGpgVerifyResultCallback
gi'cb Ptr Repo
gi'selfPtr CString
checksum Ptr GpgVerifyResult
result_ Ptr ()
_ = do
    checksum' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
checksum
    result_' <- (newObject OSTree.GpgVerifyResult.GpgVerifyResult) result_
    B.ManagedPtr.withNewObject gi'selfPtr $ \Repo
gi'self -> a -> RepoGpgVerifyResultCallback
gi'cb (Repo -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Repo
gi'self)  Text
checksum' GpgVerifyResult
result_'


-- | Connect a signal handler for the [gpgVerifyResult](#signal:gpgVerifyResult) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' repo #gpgVerifyResult callback
-- @
-- 
-- 
onRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> ((?self :: a) => RepoGpgVerifyResultCallback) -> m SignalHandlerId
onRepoGpgVerifyResult :: forall a (m :: * -> *).
(IsRepo a, MonadIO m) =>
a
-> ((?self::a) => RepoGpgVerifyResultCallback) -> m SignalHandlerId
onRepoGpgVerifyResult a
obj (?self::a) => RepoGpgVerifyResultCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> RepoGpgVerifyResultCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => RepoGpgVerifyResultCallback
RepoGpgVerifyResultCallback
cb
    let wrapped' :: C_RepoGpgVerifyResultCallback
wrapped' = (a -> RepoGpgVerifyResultCallback) -> C_RepoGpgVerifyResultCallback
forall a.
GObject a =>
(a -> RepoGpgVerifyResultCallback) -> C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback a -> RepoGpgVerifyResultCallback
wrapped
    wrapped'' <- C_RepoGpgVerifyResultCallback
-> IO (FunPtr C_RepoGpgVerifyResultCallback)
mk_RepoGpgVerifyResultCallback C_RepoGpgVerifyResultCallback
wrapped'
    connectSignalFunPtr obj "gpg-verify-result" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [gpgVerifyResult](#signal:gpgVerifyResult) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' repo #gpgVerifyResult callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> ((?self :: a) => RepoGpgVerifyResultCallback) -> m SignalHandlerId
afterRepoGpgVerifyResult :: forall a (m :: * -> *).
(IsRepo a, MonadIO m) =>
a
-> ((?self::a) => RepoGpgVerifyResultCallback) -> m SignalHandlerId
afterRepoGpgVerifyResult a
obj (?self::a) => RepoGpgVerifyResultCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> RepoGpgVerifyResultCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => RepoGpgVerifyResultCallback
RepoGpgVerifyResultCallback
cb
    let wrapped' :: C_RepoGpgVerifyResultCallback
wrapped' = (a -> RepoGpgVerifyResultCallback) -> C_RepoGpgVerifyResultCallback
forall a.
GObject a =>
(a -> RepoGpgVerifyResultCallback) -> C_RepoGpgVerifyResultCallback
wrap_RepoGpgVerifyResultCallback a -> RepoGpgVerifyResultCallback
wrapped
    wrapped'' <- C_RepoGpgVerifyResultCallback
-> IO (FunPtr C_RepoGpgVerifyResultCallback)
mk_RepoGpgVerifyResultCallback C_RepoGpgVerifyResultCallback
wrapped'
    connectSignalFunPtr obj "gpg-verify-result" wrapped'' SignalConnectAfter Nothing


#if defined(ENABLE_OVERLOADING)
data RepoGpgVerifyResultSignalInfo
instance SignalInfo RepoGpgVerifyResultSignalInfo where
    type HaskellCallbackType RepoGpgVerifyResultSignalInfo = RepoGpgVerifyResultCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_RepoGpgVerifyResultCallback cb
        cb'' <- mk_RepoGpgVerifyResultCallback cb'
        connectSignalFunPtr obj "gpg-verify-result" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.Repo::gpg-verify-result"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-Repo.html#g:signal:gpgVerifyResult"})

#endif

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

-- | Get the value of the “@path@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repo #path
-- @
getRepoPath :: (MonadIO m, IsRepo o) => o -> m Gio.File.File
getRepoPath :: forall (m :: * -> *) o. (MonadIO m, IsRepo o) => o -> m File
getRepoPath o
obj = IO File -> m File
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe File) -> IO File
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getRepoPath" (IO (Maybe File) -> IO File) -> IO (Maybe File) -> IO File
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"path" ManagedPtr File -> File
Gio.File.File

-- | Construct a t'GValueConstruct' with valid value for the “@path@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepoPath :: (IsRepo o, MIO.MonadIO m, Gio.File.IsFile a) => a -> m (GValueConstruct o)
constructRepoPath :: forall o (m :: * -> *) a.
(IsRepo o, MonadIO m, IsFile a) =>
a -> m (GValueConstruct o)
constructRepoPath a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"path" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

#if defined(ENABLE_OVERLOADING)
data RepoPathPropertyInfo
instance AttrInfo RepoPathPropertyInfo where
    type AttrAllowedOps RepoPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepoPathPropertyInfo = IsRepo
    type AttrSetTypeConstraint RepoPathPropertyInfo = Gio.File.IsFile
    type AttrTransferTypeConstraint RepoPathPropertyInfo = Gio.File.IsFile
    type AttrTransferType RepoPathPropertyInfo = Gio.File.File
    type AttrGetType RepoPathPropertyInfo = Gio.File.File
    type AttrLabel RepoPathPropertyInfo = "path"
    type AttrOrigin RepoPathPropertyInfo = Repo
    attrGet = getRepoPath
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        unsafeCastTo Gio.File.File v
    attrConstruct = constructRepoPath
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.Repo.path"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-Repo.html#g:attr:path"
        })
#endif

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

-- | Get the value of the “@remotes-config-dir@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repo #remotesConfigDir
-- @
getRepoRemotesConfigDir :: (MonadIO m, IsRepo o) => o -> m (Maybe T.Text)
getRepoRemotesConfigDir :: forall (m :: * -> *) o.
(MonadIO m, IsRepo o) =>
o -> m (Maybe Text)
getRepoRemotesConfigDir o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"remotes-config-dir"

-- | Construct a t'GValueConstruct' with valid value for the “@remotes-config-dir@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepoRemotesConfigDir :: (IsRepo o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructRepoRemotesConfigDir :: forall o (m :: * -> *).
(IsRepo o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructRepoRemotesConfigDir Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"remotes-config-dir" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

#if defined(ENABLE_OVERLOADING)
data RepoRemotesConfigDirPropertyInfo
instance AttrInfo RepoRemotesConfigDirPropertyInfo where
    type AttrAllowedOps RepoRemotesConfigDirPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepoRemotesConfigDirPropertyInfo = IsRepo
    type AttrSetTypeConstraint RepoRemotesConfigDirPropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint RepoRemotesConfigDirPropertyInfo = (~) T.Text
    type AttrTransferType RepoRemotesConfigDirPropertyInfo = T.Text
    type AttrGetType RepoRemotesConfigDirPropertyInfo = (Maybe T.Text)
    type AttrLabel RepoRemotesConfigDirPropertyInfo = "remotes-config-dir"
    type AttrOrigin RepoRemotesConfigDirPropertyInfo = Repo
    attrGet = getRepoRemotesConfigDir
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructRepoRemotesConfigDir
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.Repo.remotesConfigDir"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-Repo.html#g:attr:remotesConfigDir"
        })
#endif

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

-- | Get the value of the “@sysroot-path@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' repo #sysrootPath
-- @
getRepoSysrootPath :: (MonadIO m, IsRepo o) => o -> m (Maybe Gio.File.File)
getRepoSysrootPath :: forall (m :: * -> *) o.
(MonadIO m, IsRepo o) =>
o -> m (Maybe File)
getRepoSysrootPath o
obj = IO (Maybe File) -> m (Maybe File)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"sysroot-path" ManagedPtr File -> File
Gio.File.File

-- | Construct a t'GValueConstruct' with valid value for the “@sysroot-path@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructRepoSysrootPath :: (IsRepo o, MIO.MonadIO m, Gio.File.IsFile a) => a -> m (GValueConstruct o)
constructRepoSysrootPath :: forall o (m :: * -> *) a.
(IsRepo o, MonadIO m, IsFile a) =>
a -> m (GValueConstruct o)
constructRepoSysrootPath a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"sysroot-path" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

#if defined(ENABLE_OVERLOADING)
data RepoSysrootPathPropertyInfo
instance AttrInfo RepoSysrootPathPropertyInfo where
    type AttrAllowedOps RepoSysrootPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint RepoSysrootPathPropertyInfo = IsRepo
    type AttrSetTypeConstraint RepoSysrootPathPropertyInfo = Gio.File.IsFile
    type AttrTransferTypeConstraint RepoSysrootPathPropertyInfo = Gio.File.IsFile
    type AttrTransferType RepoSysrootPathPropertyInfo = Gio.File.File
    type AttrGetType RepoSysrootPathPropertyInfo = (Maybe Gio.File.File)
    type AttrLabel RepoSysrootPathPropertyInfo = "sysroot-path"
    type AttrOrigin RepoSysrootPathPropertyInfo = Repo
    attrGet = getRepoSysrootPath
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        unsafeCastTo Gio.File.File v
    attrConstruct = constructRepoSysrootPath
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Objects.Repo.sysrootPath"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Objects-Repo.html#g:attr:sysrootPath"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Repo
type instance O.AttributeList Repo = RepoAttributeList
type RepoAttributeList = ('[ '("path", RepoPathPropertyInfo), '("remotesConfigDir", RepoRemotesConfigDirPropertyInfo), '("sysrootPath", RepoSysrootPathPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
repoPath :: AttrLabelProxy "path"
repoPath = AttrLabelProxy

repoRemotesConfigDir :: AttrLabelProxy "remotesConfigDir"
repoRemotesConfigDir = AttrLabelProxy

repoSysrootPath :: AttrLabelProxy "sysrootPath"
repoSysrootPath = AttrLabelProxy

#endif

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

#endif

-- method Repo::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "path"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Path to a repository"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFile a) =>
a -> m Repo
repoNew a
path = IO Repo -> m Repo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
    path' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
path
    result <- ostree_repo_new path'
    checkUnexpectedReturnNULL "repoNew" result
    result' <- (wrapObject Repo) result
    touchManagedPtr path
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- 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 t'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 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Repo
repoNewDefault  = IO Repo -> m Repo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
    result <- IO (Ptr Repo)
ostree_repo_new_default
    checkUnexpectedReturnNULL "repoNewDefault" result
    result' <- (wrapObject Repo) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Repo::new_for_sysroot_path
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "repo_path"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Path to a repository"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sysroot_path"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Path to the system root"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 t'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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFile a, IsFile b) =>
a -> b -> m Repo
repoNewForSysrootPath a
repoPath b
sysrootPath = IO Repo -> m Repo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
    repoPath' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
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'

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "ostree_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

-- | Abort the active transaction; any staged objects and ref changes will be
-- discarded. You *must* invoke this if you have chosen not to invoke
-- 'GI.OSTree.Objects.Repo.repoCommitTransaction'. Calling this function when not in a
-- transaction will do nothing and return successfully.
repoAbortTransaction ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoAbortTransaction :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m ()
repoAbortTransaction a
self Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_abort_transaction self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoAbortTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoAbortTransactionMethodInfo a signature where
    overloadedMethod = repoAbortTransaction

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


#endif

-- method Repo::add_gpg_signature_summary
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_id"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "const gchar**"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "NULL-terminated array of GPG keys."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "homedir"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GPG home directory, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 summary file.
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 'P.Nothing'
    -> Maybe (b)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoAddGpgSignatureSummary :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> [Text] -> Maybe Text -> Maybe b -> m ()
repoAddGpgSignatureSummary a
self [Text]
keyId Maybe Text
homedir Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    keyId' <- packZeroTerminatedUTF8CArray keyId
    maybeHomedir <- case homedir of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jHomedir -> do
            jHomedir' <- Text -> IO CString
textToCString Text
jHomedir
            return jHomedir'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::append_gpg_signature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "SHA256 of given commit to sign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signature_bytes"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Signature data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoAppendGpgSignature :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Bytes -> Maybe b -> m ()
repoAppendGpgSignature a
self Text
commitChecksum Bytes
signatureBytes Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    commitChecksum' <- textToCString commitChecksum
    signatureBytes' <- unsafeManagedPtrGetPtr signatureBytes
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_append_gpg_signature self' commitChecksum' signatureBytes' maybeCancellable
        touchManagedPtr self
        touchManagedPtr signatureBytes
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        return ()
     ) (do
        freeMem commitChecksum'
     )

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

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


#endif

-- method Repo::checkout_at
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoCheckoutAtOptions" }
--           , argCType = Just "OstreeRepoCheckoutAtOptions*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Options" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destination_dfd"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Directory FD for destination"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destination_path"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Directory for destination"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Checksum for commit"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.
-- 
-- /Since: 2016.8/
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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> Maybe RepoCheckoutAtOptions
-> Int32
-> Text
-> Text
-> Maybe b
-> m ()
repoCheckoutAt a
self Maybe RepoCheckoutAtOptions
options Int32
destinationDfd Text
destinationPath Text
commit Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeOptions <- case options of
        Maybe RepoCheckoutAtOptions
Nothing -> Ptr RepoCheckoutAtOptions -> IO (Ptr RepoCheckoutAtOptions)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCheckoutAtOptions
forall a. Ptr a
FP.nullPtr
        Just RepoCheckoutAtOptions
jOptions -> do
            jOptions' <- RepoCheckoutAtOptions -> IO (Ptr RepoCheckoutAtOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCheckoutAtOptions
jOptions
            return jOptions'
    destinationPath' <- textToCString destinationPath
    commit' <- textToCString commit
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoCheckoutAtMethodInfo a signature where
    overloadedMethod = repoCheckoutAt

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


#endif

-- method Repo::checkout_composefs
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "If non-NULL, must be a GVariant of type a{sv}. See below."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destination_dfd"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Parent directory fd"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destination_path"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Filename" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OStree commit digest"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_checkout_composefs" ostree_repo_checkout_composefs :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr GVariant ->                         -- options : TVariant
    Int32 ->                                -- destination_dfd : TBasicType TInt
    CString ->                              -- destination_path : TBasicType TUTF8
    CString ->                              -- checksum : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Create a composefs filesystem metadata blob from an OSTree commit. Supported
-- options:
-- 
-- * verity: @u@: 0 = disabled, 1 = set if present on file, 2 = enabled; any other value is a fatal
-- 
-- error
-- 
-- /Since: 2024.7/
repoCheckoutComposefs ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: A repo
    -> Maybe (GVariant)
    -- ^ /@options@/: If non-NULL, must be a GVariant of type a{sv}. See below.
    -> Int32
    -- ^ /@destinationDfd@/: Parent directory fd
    -> T.Text
    -- ^ /@destinationPath@/: Filename
    -> T.Text
    -- ^ /@checksum@/: OStree commit digest
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoCheckoutComposefs :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe GVariant -> Int32 -> Text -> Text -> Maybe b -> m ()
repoCheckoutComposefs a
self Maybe GVariant
options Int32
destinationDfd Text
destinationPath Text
checksum Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    destinationPath' <- textToCString destinationPath
    checksum' <- textToCString checksum
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_checkout_composefs self' maybeOptions destinationDfd destinationPath' checksum' maybeCancellable
        touchManagedPtr self
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem destinationPath'
        freeMem checksum'
        return ()
     ) (do
        freeMem destinationPath'
        freeMem checksum'
     )

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

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


#endif

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

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m ()
repoCheckoutGc a
self Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_checkout_gc self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoCheckoutGcMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoCheckoutGcMethodInfo a signature where
    overloadedMethod = repoCheckoutGc

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


#endif

-- method Repo::checkout_tree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mode"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoCheckoutMode" }
--           , argCType = Just "OstreeRepoCheckoutMode"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Options controlling all files"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "overwrite_mode"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoCheckoutOverwriteMode" }
--           , argCType = Just "OstreeRepoCheckoutOverwriteMode"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Whether or not to overwrite files"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destination"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Place tree here" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFile" }
--           , argCType = Just "OstreeRepoFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Source tree" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source_info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "FileInfo" }
--           , argCType = Just "GFileInfo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Source info" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c d e.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsRepoFile c,
 IsFileInfo d, IsCancellable e) =>
a
-> RepoCheckoutMode
-> RepoCheckoutOverwriteMode
-> b
-> c
-> d
-> Maybe e
-> m ()
repoCheckoutTree a
self RepoCheckoutMode
mode RepoCheckoutOverwriteMode
overwriteMode b
destination c
source d
sourceInfo Maybe e
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (RepoCheckoutMode -> Int) -> RepoCheckoutMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoCheckoutMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoCheckoutMode
mode
    let overwriteMode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (RepoCheckoutOverwriteMode -> Int)
-> RepoCheckoutOverwriteMode
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoCheckoutOverwriteMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoCheckoutOverwriteMode
overwriteMode
    destination' <- unsafeManagedPtrCastPtr destination
    source' <- unsafeManagedPtrCastPtr source
    sourceInfo' <- unsafeManagedPtrCastPtr sourceInfo
    maybeCancellable <- case cancellable of
        Maybe e
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just e
jCancellable -> do
            jCancellable' <- e -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr e
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 ()
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoCheckoutTreeMethodInfo a signature where
    overloadedMethod = repoCheckoutTree

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


#endif

-- method Repo::commit_add_composefs_metadata
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "format_version"
--           , argType = TBasicType TUInt
--           , argCType = Just "guint"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Must be zero" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dict"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "VariantDict" }
--           , argCType = Just "GVariantDict*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A GVariant builder of type a{sv}"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "repo_root"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFile" }
--           , argCType = Just "OstreeRepoFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the target filesystem tree"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_commit_add_composefs_metadata" ostree_repo_commit_add_composefs_metadata :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Word32 ->                               -- format_version : TBasicType TUInt
    Ptr GLib.VariantDict.VariantDict ->     -- dict : TInterface (Name {namespace = "GLib", name = "VariantDict"})
    Ptr OSTree.RepoFile.RepoFile ->         -- repo_root : TInterface (Name {namespace = "OSTree", name = "RepoFile"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Compute the composefs digest for a filesystem tree
-- and insert it into metadata for a commit object.  The composefs
-- digest covers the entire filesystem tree and can be verified by
-- the composefs mount tooling.
repoCommitAddComposefsMetadata ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: Repo
    -> Word32
    -- ^ /@formatVersion@/: Must be zero
    -> GLib.VariantDict.VariantDict
    -- ^ /@dict@/: A GVariant builder of type a{sv}
    -> b
    -- ^ /@repoRoot@/: the target filesystem tree
    -> Maybe (c)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoCommitAddComposefsMetadata :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsRepoFile b,
 IsCancellable c) =>
a -> Word32 -> VariantDict -> b -> Maybe c -> m ()
repoCommitAddComposefsMetadata a
self Word32
formatVersion VariantDict
dict b
repoRoot Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    dict' <- unsafeManagedPtrGetPtr dict
    repoRoot' <- unsafeManagedPtrCastPtr repoRoot
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_commit_add_composefs_metadata self' formatVersion dict' repoRoot' maybeCancellable
        touchManagedPtr self
        touchManagedPtr dict
        touchManagedPtr repoRoot
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoCommitAddComposefsMetadataMethodInfo
instance (signature ~ (Word32 -> GLib.VariantDict.VariantDict -> b -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.RepoFile.IsRepoFile b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod RepoCommitAddComposefsMetadataMethodInfo a signature where
    overloadedMethod = repoCommitAddComposefsMetadata

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


#endif

-- method Repo::commit_transaction
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_stats"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoTransactionStats" }
--           , argCType = Just "OstreeRepoTransactionStats*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.
-- 
-- Note that if multiple threads are performing writes, all such threads must
-- have terminated before this function is invoked.
-- 
-- Locking: Releases @shared@ lock acquired by @ostree_repo_prepare_transaction()@
-- Multithreading: This function is *not* MT safe; only one transaction can be
-- active at a time.
repoCommitTransaction ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m (OSTree.RepoTransactionStats.RepoTransactionStats)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoCommitTransaction :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m RepoTransactionStats
repoCommitTransaction a
self Maybe b
cancellable = IO RepoTransactionStats -> m RepoTransactionStats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoTransactionStats -> m RepoTransactionStats)
-> IO RepoTransactionStats -> m RepoTransactionStats
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    outStats <- SP.callocBoxedBytes 56 :: IO (Ptr OSTree.RepoTransactionStats.RepoTransactionStats)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_commit_transaction self' outStats maybeCancellable
        outStats' <- (wrapBoxed OSTree.RepoTransactionStats.RepoTransactionStats) outStats
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return outStats'
     ) (do
        freeMem outStats
     )

#if defined(ENABLE_OVERLOADING)
data RepoCommitTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m (OSTree.RepoTransactionStats.RepoTransactionStats)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoCommitTransactionMethodInfo a signature where
    overloadedMethod = repoCommitTransaction

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


#endif

-- method Repo::copy_config
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m KeyFile
repoCopyConfig a
self = IO KeyFile -> m KeyFile
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO KeyFile -> m KeyFile) -> IO KeyFile -> m KeyFile
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_copy_config self'
    checkUnexpectedReturnNULL "repoCopyConfig" result
    result' <- (wrapBoxed GLib.KeyFile.KeyFile) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoCopyConfigMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsRepo a) => O.OverloadedMethod RepoCopyConfigMethodInfo a signature where
    overloadedMethod = repoCopyConfig

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


#endif

-- method Repo::create
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mode"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoMode" }
--           , argCType = Just "OstreeRepoMode"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.
-- 
-- Since 2017.9, \"existing repository\" is defined by the existence of an
-- @objects@ subdirectory.
-- 
-- This function predates 'GI.OSTree.Objects.Repo.repoCreateAt'. It is an error to call
-- this function on a repository initialized via 'GI.OSTree.Objects.Repo.repoOpenAt'.
repoCreate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> RepoMode -> Maybe b -> m ()
repoCreate a
self RepoMode
mode Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RepoMode -> Int) -> RepoMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoMode
mode
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_create self' mode' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

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

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


#endif

-- method Repo::delete_object
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sha256"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> ObjectType -> Text -> Maybe b -> m ()
repoDeleteObject a
self ObjectType
objtype Text
sha256 Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    sha256' <- textToCString sha256
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_delete_object self' objtype' sha256' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem sha256'
        return ()
     ) (do
        freeMem sha256'
     )

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

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


#endif

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

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

-- | Check whether two opened repositories are the same on disk: if their root
-- directories are the same inode. If /@a@/ or /@b@/ are not open yet (due to
-- 'GI.OSTree.Objects.Repo.repoOpen' not being called on them yet), 'P.False' will be returned.
-- 
-- /Since: 2017.12/
repoEqual ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, IsRepo b) =>
    a
    -- ^ /@a@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> b
    -- ^ /@b@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@a@/ and /@b@/ are the same repository on disk, 'P.False' otherwise
repoEqual :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsRepo b) =>
a -> b -> m Bool
repoEqual a
a b
b = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    a' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
a
    b' <- unsafeManagedPtrCastPtr b
    result <- ostree_repo_equal a' b'
    let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    touchManagedPtr a
    touchManagedPtr b
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsRepo a, IsRepo b) => O.OverloadedMethod RepoEqualMethodInfo a signature where
    overloadedMethod = repoEqual

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


#endif

-- method Repo::find_remotes_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refs"
--           , argType =
--               TCArray
--                 True
--                 (-1)
--                 (-1)
--                 (TInterface Name { namespace = "OSTree" , name = "CollectionRef" })
--           , argCType = Just "const OstreeCollectionRef* const*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "non-empty array of collection\8211ref pairs to find remotes for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "finders"
--           , argType =
--               TCArray
--                 True
--                 (-1)
--                 (-1)
--                 (TInterface Name { namespace = "OSTree" , name = "RepoFinder" })
--           , argCType = Just "OstreeRepoFinder**"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "non-empty array of\n   #OstreeRepoFinder instances to use, or %NULL to use the system defaults"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "an #OstreeAsyncProgress to update with the operation\8217s\n   progress, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , argCType = Just "GAsyncReadyCallback"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "asynchronous completion callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 7
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_find_remotes_async" ostree_repo_find_remotes_async :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr (Ptr OSTree.CollectionRef.CollectionRef) -> -- refs : TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "CollectionRef"}))
    Ptr GVariant ->                         -- options : TVariant
    Ptr (Ptr OSTree.RepoFinder.RepoFinder) -> -- finders : TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "RepoFinder"}))
    Ptr OSTree.AsyncProgress.AsyncProgress -> -- progress : TInterface (Name {namespace = "OSTree", name = "AsyncProgress"})
    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 ()

-- | Find reachable remote URIs which claim to provide any of the given named
-- /@refs@/. This will search for configured remotes (t'GI.OSTree.Objects.RepoFinderConfig.RepoFinderConfig'),
-- mounted volumes (t'GI.OSTree.Objects.RepoFinderMount.RepoFinderMount') and (if enabled at compile time)
-- local network peers (t'GI.OSTree.Objects.RepoFinderAvahi.RepoFinderAvahi'). In order to use a custom
-- configuration of t'GI.OSTree.Interfaces.RepoFinder.RepoFinder' instances, call
-- 'GI.OSTree.Functions.repoFinderResolveAllAsync' on them individually.
-- 
-- Any remote which is found and which claims to support any of the given /@refs@/
-- will be returned in the results. It is possible that a remote claims to
-- support a given ref, but turns out not to — it is not possible to verify this
-- until 'GI.OSTree.Objects.Repo.repoPullFromRemotesAsync' is called.
-- 
-- The returned results will be sorted with the most useful first — this is
-- typically the remote which claims to provide the most of /@refs@/, at the lowest
-- latency.
-- 
-- Each result contains a list of the subset of /@refs@/ it claims to provide. It
-- is possible for a non-empty list of results to be returned, but for some of
-- /@refs@/ to not be listed in any of the results. Callers must check for this.
-- 
-- Pass the results to 'GI.OSTree.Objects.Repo.repoPullFromRemotesAsync' to pull the given /@refs@/
-- from those remotes.
-- 
-- The following /@options@/ are currently defined:
-- 
--   * @override-commit-ids@ (@as@): Array of specific commit IDs to fetch. The nth
--   commit ID applies to the nth ref, so this must be the same length as /@refs@/, if
--   provided.
--   * @n-network-retries@ (@u@): Number of times to retry each download on
--   receiving a transient network error, such as a socket timeout; default is
--   5, 0 means return errors without retrying. Since: 2018.6
-- 
-- /@finders@/ must be a non-empty 'P.Nothing'-terminated array of the t'GI.OSTree.Interfaces.RepoFinder.RepoFinder'
-- instances to use, or 'P.Nothing' to use the system default set of finders, which
-- will typically be all available finders using their default options (but
-- this is not guaranteed).
-- 
-- GPG verification of commits will be used unconditionally.
-- 
-- This will use the thread-default t'GI.GLib.Structs.MainContext.MainContext', but will not iterate it.
-- 
-- /Since: 2018.6/
repoFindRemotesAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> [OSTree.CollectionRef.CollectionRef]
    -- ^ /@refs@/: non-empty array of collection–ref pairs to find remotes for
    -> Maybe (GVariant)
    -- ^ /@options@/: a GVariant @a{sv}@ with an extensible set of flags
    -> [OSTree.RepoFinder.RepoFinder]
    -- ^ /@finders@/: non-empty array of
    --    t'GI.OSTree.Interfaces.RepoFinder.RepoFinder' instances to use, or 'P.Nothing' to use the system defaults
    -> Maybe (b)
    -- ^ /@progress@/: an t'GI.OSTree.Objects.AsyncProgress.AsyncProgress' to update with the operation’s
    --    progress, or 'P.Nothing'
    -> Maybe (c)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: asynchronous completion callback
    -> m ()
repoFindRemotesAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b,
 IsCancellable c) =>
a
-> [CollectionRef]
-> Maybe GVariant
-> [RepoFinder]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoFindRemotesAsync a
self [CollectionRef]
refs Maybe GVariant
options [RepoFinder]
finders Maybe b
progress Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    refs' <- mapM unsafeManagedPtrGetPtr refs
    refs'' <- packZeroTerminatedPtrArray refs'
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    finders' <- mapM unsafeManagedPtrCastPtr finders
    finders'' <- packZeroTerminatedPtrArray finders'
    maybeProgress <- case progress of
        Maybe b
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr
        Just b
jProgress -> do
            jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    maybeCallback <- case callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = Ptr a
forall a. Ptr a
nullPtr
    ostree_repo_find_remotes_async self' refs'' maybeOptions finders'' maybeProgress maybeCancellable maybeCallback userData
    touchManagedPtr self
    mapM_ touchManagedPtr refs
    whenJust options touchManagedPtr
    mapM_ touchManagedPtr finders
    whenJust progress touchManagedPtr
    whenJust cancellable touchManagedPtr
    freeMem refs''
    freeMem finders''
    return ()

#if defined(ENABLE_OVERLOADING)
data RepoFindRemotesAsyncMethodInfo
instance (signature ~ ([OSTree.CollectionRef.CollectionRef] -> Maybe (GVariant) -> [OSTree.RepoFinder.RepoFinder] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod RepoFindRemotesAsyncMethodInfo a signature where
    overloadedMethod = repoFindRemotesAsync

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


#endif

-- method Repo::find_remotes_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , argCType = Just "GAsyncResult*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the asynchronous result"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TCArray
--                  True
--                  (-1)
--                  (-1)
--                  (TInterface
--                     Name { namespace = "OSTree" , name = "RepoFinderResult" }))
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_find_remotes_finish" ostree_repo_find_remotes_finish :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr (Ptr OSTree.RepoFinderResult.RepoFinderResult))

-- | Finish an asynchronous pull operation started with
-- 'GI.OSTree.Objects.Repo.repoFindRemotesAsync'.
-- 
-- /Since: 2018.6/
repoFindRemotesFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> b
    -- ^ /@result@/: the asynchronous result
    -> m [OSTree.RepoFinderResult.RepoFinderResult]
    -- ^ __Returns:__ a potentially empty array
    --    of @/OstreeRepoFinderResults/@, followed by a 'P.Nothing' terminator element; or
    --    'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
repoFindRemotesFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) =>
a -> b -> m [RepoFinderResult]
repoFindRemotesFinish a
self b
result_ = IO [RepoFinderResult] -> m [RepoFinderResult]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [RepoFinderResult] -> m [RepoFinderResult])
-> IO [RepoFinderResult] -> m [RepoFinderResult]
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        result <- propagateGError $ ostree_repo_find_remotes_finish self' result_'
        checkUnexpectedReturnNULL "repoFindRemotesFinish" result
        result' <- unpackZeroTerminatedPtrArray result
        result'' <- mapM (wrapBoxed OSTree.RepoFinderResult.RepoFinderResult) result'
        freeMem result
        touchManagedPtr self
        touchManagedPtr result_
        return result''
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoFindRemotesFinishMethodInfo
instance (signature ~ (b -> m [OSTree.RepoFinderResult.RepoFinderResult]), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod RepoFindRemotesFinishMethodInfo a signature where
    overloadedMethod = repoFindRemotesFinish

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


#endif

-- method Repo::fsck_object
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sha256"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_fsck_object" ostree_repo_fsck_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

-- | Verify consistency of the object; this performs checks only relevant to the
-- immediate object itself, such as checksumming. This API call will not itself
-- traverse metadata objects for example.
-- 
-- /Since: 2017.15/
repoFsckObject ::
    (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')/
repoFsckObject :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> ObjectType -> Text -> Maybe b -> m ()
repoFsckObject a
self ObjectType
objtype Text
sha256 Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    sha256' <- textToCString sha256
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_fsck_object self' objtype' sha256' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem sha256'
        return ()
     ) (do
        freeMem sha256'
     )

#if defined(ENABLE_OVERLOADING)
data RepoFsckObjectMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoFsckObjectMethodInfo a signature where
    overloadedMethod = repoFsckObject

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


#endif

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

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

-- | Get the bootloader configured. See the documentation for the
-- \"sysroot.bootloader\" config key.
-- 
-- /Since: 2019.2/
repoGetBootloader ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> m T.Text
    -- ^ __Returns:__ bootloader configuration for the sysroot
repoGetBootloader :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m Text
repoGetBootloader a
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_bootloader self'
    checkUnexpectedReturnNULL "repoGetBootloader" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoGetBootloaderMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetBootloaderMethodInfo a signature where
    overloadedMethod = repoGetBootloader

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


#endif

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

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

-- | Get the collection ID of this repository. See [collection IDs][collection-ids].
-- 
-- /Since: 2018.6/
repoGetCollectionId ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> m (Maybe T.Text)
    -- ^ __Returns:__ collection ID for the repository
repoGetCollectionId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m (Maybe Text)
repoGetCollectionId a
self = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_collection_id self'
    maybeResult <- convertIfNonNull result $ \CString
result' -> do
        result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data RepoGetCollectionIdMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetCollectionIdMethodInfo a signature where
    overloadedMethod = repoGetCollectionId

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


#endif

-- method Repo::get_config
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m KeyFile
repoGetConfig a
self = IO KeyFile -> m KeyFile
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO KeyFile -> m KeyFile) -> IO KeyFile -> m KeyFile
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_config self'
    checkUnexpectedReturnNULL "repoGetConfig" result
    result' <- (newBoxed GLib.KeyFile.KeyFile) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoGetConfigMethodInfo
instance (signature ~ (m GLib.KeyFile.KeyFile), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetConfigMethodInfo a signature where
    overloadedMethod = repoGetConfig

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


#endif

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

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

-- | Get the set of default repo finders configured. See the documentation for
-- the \"core.default-repo-finders\" config key.
-- 
-- /Since: 2018.9/
repoGetDefaultRepoFinders ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> m [T.Text]
    -- ^ __Returns:__ 
    --    'P.Nothing'-terminated array of strings.
repoGetDefaultRepoFinders :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m [Text]
repoGetDefaultRepoFinders a
self = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_default_repo_finders self'
    checkUnexpectedReturnNULL "repoGetDefaultRepoFinders" result
    result' <- unpackZeroTerminatedUTF8CArray result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoGetDefaultRepoFindersMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetDefaultRepoFindersMethodInfo a signature where
    overloadedMethod = repoGetDefaultRepoFinders

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


#endif

-- method Repo::get_dfd
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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).
-- 
-- /Since: 2016.4/
repoGetDfd ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> m Int32
    -- ^ __Returns:__ File descriptor for repository root - owned by /@self@/
repoGetDfd :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m Int32
repoGetDfd a
self = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_dfd self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data RepoGetDfdMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetDfdMethodInfo a signature where
    overloadedMethod = repoGetDfd

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


#endif

-- method Repo::get_disable_fsync
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 t'GI.OSTree.Objects.Repo.Repo'
    -> m Bool
    -- ^ __Returns:__ Whether or not @/fsync()/@ is enabled for this repo.
repoGetDisableFsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m Bool
repoGetDisableFsync a
self = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_disable_fsync self'
    let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoGetDisableFsyncMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetDisableFsyncMethodInfo a signature where
    overloadedMethod = repoGetDisableFsync

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


#endif

-- method Repo::get_min_free_space_bytes
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_reserved_bytes"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Location to store the result"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_get_min_free_space_bytes" ostree_repo_get_min_free_space_bytes :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Word64 ->                           -- out_reserved_bytes : TBasicType TUInt64
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Determine the number of bytes of free disk space that are reserved according
-- to the repo config and return that number in /@outReservedBytes@/. See the
-- documentation for the core.min-free-space-size and
-- core.min-free-space-percent repo config options.
-- 
-- /Since: 2018.9/
repoGetMinFreeSpaceBytes ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> m (Word64)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoGetMinFreeSpaceBytes :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m Word64
repoGetMinFreeSpaceBytes a
self = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    outReservedBytes <- allocMem :: IO (Ptr Word64)
    onException (do
        _ <- propagateGError $ ostree_repo_get_min_free_space_bytes self' outReservedBytes
        outReservedBytes' <- peek outReservedBytes
        touchManagedPtr self
        freeMem outReservedBytes
        return outReservedBytes'
     ) (do
        freeMem outReservedBytes
     )

#if defined(ENABLE_OVERLOADING)
data RepoGetMinFreeSpaceBytesMethodInfo
instance (signature ~ (m (Word64)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetMinFreeSpaceBytesMethodInfo a signature where
    overloadedMethod = repoGetMinFreeSpaceBytes

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


#endif

-- method Repo::get_mode
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m RepoMode
repoGetMode a
self = IO RepoMode -> m RepoMode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoMode -> m RepoMode) -> IO RepoMode -> m RepoMode
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_mode self'
    let result' = (Int -> RepoMode
forall a. Enum a => Int -> a
toEnum (Int -> RepoMode) -> (CUInt -> Int) -> CUInt -> RepoMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoGetModeMethodInfo
instance (signature ~ (m OSTree.Enums.RepoMode), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetModeMethodInfo a signature where
    overloadedMethod = repoGetMode

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


#endif

-- method Repo::get_parent
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 (Maybe Repo)
    -- ^ __Returns:__ Parent repository, or 'P.Nothing' if none
repoGetParent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m (Maybe Repo)
repoGetParent a
self = IO (Maybe Repo) -> m (Maybe Repo)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Repo) -> m (Maybe Repo))
-> IO (Maybe Repo) -> m (Maybe Repo)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_parent self'
    maybeResult <- convertIfNonNull result $ \Ptr Repo
result' -> do
        result'' <- ((ManagedPtr Repo -> Repo) -> Ptr Repo -> IO Repo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Repo -> Repo
Repo) Ptr Repo
result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data RepoGetParentMethodInfo
instance (signature ~ (m (Maybe Repo)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetParentMethodInfo a signature where
    overloadedMethod = repoGetParent

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


#endif

-- method Repo::get_path
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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)

-- | Note that since the introduction of 'GI.OSTree.Objects.Repo.repoOpenAt', this function may
-- return a process-specific path in @\/proc@ if the repository was created using
-- that API. In general, you should avoid use of this API.
repoGetPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> m Gio.File.File
    -- ^ __Returns:__ Path to repo
repoGetPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m File
repoGetPath a
self = IO File -> m File
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_get_path self'
    checkUnexpectedReturnNULL "repoGetPath" result
    result' <- (newObject Gio.File.File) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoGetPathMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetPathMethodInfo a signature where
    overloadedMethod = repoGetPath

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


#endif

-- method Repo::get_remote_boolean_option
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "option_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Option" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "default_value"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_value"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store the result."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 'P.False'.
-- 
-- /Since: 2016.5/
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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Text -> Bool -> m Bool
repoGetRemoteBooleanOption a
self Text
remoteName Text
optionName Bool
defaultValue = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteName' <- textToCString remoteName
    optionName' <- textToCString optionName
    let defaultValue' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
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'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outValue'
        touchManagedPtr self
        freeMem remoteName'
        freeMem optionName'
        freeMem outValue
        return outValue''
     ) (do
        freeMem remoteName'
        freeMem optionName'
        freeMem outValue
     )

#if defined(ENABLE_OVERLOADING)
data RepoGetRemoteBooleanOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> Bool -> m (Bool)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetRemoteBooleanOptionMethodInfo a signature where
    overloadedMethod = repoGetRemoteBooleanOption

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


#endif

-- method Repo::get_remote_list_option
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "option_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Option" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_value"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "char***"
--           , 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
--           , argCallbackUserData = 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 'P.Nothing'.
-- 
-- /Since: 2016.5/
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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Text -> m [Text]
repoGetRemoteListOption a
self Text
remoteName Text
optionName = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteName' <- textToCString remoteName
    optionName' <- textToCString optionName
    outValue <- callocMem :: 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
     )

#if defined(ENABLE_OVERLOADING)
data RepoGetRemoteListOptionMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ([T.Text])), MonadIO m, IsRepo a) => O.OverloadedMethod RepoGetRemoteListOptionMethodInfo a signature where
    overloadedMethod = repoGetRemoteListOption

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


#endif

-- method Repo::get_remote_option
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "option_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Option" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "default_value"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_value"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Return location for value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 'P.Nothing'.
-- 
-- /Since: 2016.5/
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 ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoGetRemoteOption :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Text -> Maybe Text -> m (Maybe Text)
repoGetRemoteOption a
self Text
remoteName Text
optionName Maybe Text
defaultValue = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteName' <- textToCString remoteName
    optionName' <- textToCString optionName
    maybeDefaultValue <- case defaultValue of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jDefaultValue -> do
            jDefaultValue' <- Text -> IO CString
textToCString Text
jDefaultValue
            return jDefaultValue'
    outValue <- callocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_get_remote_option self' remoteName' optionName' maybeDefaultValue outValue
        outValue' <- peek outValue
        maybeOutValue' <- convertIfNonNull outValue' $ \CString
outValue'' -> do
            outValue''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outValue''
            return outValue'''
        freeMem outValue'
        touchManagedPtr self
        freeMem remoteName'
        freeMem optionName'
        freeMem maybeDefaultValue
        freeMem outValue
        return maybeOutValue'
     ) (do
        freeMem remoteName'
        freeMem optionName'
        freeMem maybeDefaultValue
        freeMem outValue
     )

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

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


#endif

-- method Repo::gpg_sign_data
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Data as a #GBytes" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "old_signatures"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Existing signatures to append to (or %NULL)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_id"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "const gchar**"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "NULL-terminated array of GPG keys."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "homedir"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GPG home directory, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_signatures"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "in case of success will contain signature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_gpg_sign_data" ostree_repo_gpg_sign_data :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr GLib.Bytes.Bytes ->                 -- data : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr GLib.Bytes.Bytes ->                 -- old_signatures : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr CString ->                          -- key_id : TCArray True (-1) (-1) (TBasicType TUTF8)
    CString ->                              -- homedir : TBasicType TUTF8
    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

-- | Sign the given /@data@/ with the specified keys in /@keyId@/. Similar to
-- 'GI.OSTree.Objects.Repo.repoAddGpgSignatureSummary' but can be used on any
-- data.
-- 
-- You can use 'GI.OSTree.Objects.Repo.repoGpgVerifyData' to verify the signatures.
-- 
-- /Since: 2020.8/
repoGpgSignData ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: Self
    -> GLib.Bytes.Bytes
    -- ^ /@data@/: Data as a t'GI.GLib.Structs.Bytes.Bytes'
    -> Maybe (GLib.Bytes.Bytes)
    -- ^ /@oldSignatures@/: Existing signatures to append to (or 'P.Nothing')
    -> [T.Text]
    -- ^ /@keyId@/: NULL-terminated array of GPG keys.
    -> Maybe (T.Text)
    -- ^ /@homedir@/: GPG home directory, or 'P.Nothing'
    -> Maybe (b)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m (GLib.Bytes.Bytes)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoGpgSignData :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> Bytes
-> Maybe Bytes
-> [Text]
-> Maybe Text
-> Maybe b
-> m Bytes
repoGpgSignData a
self Bytes
data_ Maybe Bytes
oldSignatures [Text]
keyId Maybe Text
homedir Maybe b
cancellable = IO Bytes -> m Bytes
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bytes -> m Bytes) -> IO Bytes -> m Bytes
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    data_' <- unsafeManagedPtrGetPtr data_
    maybeOldSignatures <- case oldSignatures of
        Maybe Bytes
Nothing -> Ptr Bytes -> IO (Ptr Bytes)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Bytes
forall a. Ptr a
FP.nullPtr
        Just Bytes
jOldSignatures -> do
            jOldSignatures' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
jOldSignatures
            return jOldSignatures'
    keyId' <- packZeroTerminatedUTF8CArray keyId
    maybeHomedir <- case homedir of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jHomedir -> do
            jHomedir' <- Text -> IO CString
textToCString Text
jHomedir
            return jHomedir'
    outSignatures <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_gpg_sign_data self' data_' maybeOldSignatures keyId' maybeHomedir outSignatures maybeCancellable
        outSignatures' <- peek outSignatures
        outSignatures'' <- (wrapBoxed GLib.Bytes.Bytes) outSignatures'
        touchManagedPtr self
        touchManagedPtr data_
        whenJust oldSignatures touchManagedPtr
        whenJust cancellable touchManagedPtr
        mapZeroTerminatedCArray freeMem keyId'
        freeMem keyId'
        freeMem maybeHomedir
        freeMem outSignatures
        return outSignatures''
     ) (do
        mapZeroTerminatedCArray freeMem keyId'
        freeMem keyId'
        freeMem maybeHomedir
        freeMem outSignatures
     )

#if defined(ENABLE_OVERLOADING)
data RepoGpgSignDataMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Maybe (GLib.Bytes.Bytes) -> [T.Text] -> Maybe (T.Text) -> Maybe (b) -> m (GLib.Bytes.Bytes)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoGpgSignDataMethodInfo a signature where
    overloadedMethod = repoGpgSignData

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


#endif

-- method Repo::gpg_verify_data
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Repository" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Data as a #GBytes" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signatures"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Signatures as a #GBytes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keyringdir"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "extra_keyring"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (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 t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult'.
-- 
-- The /@remoteName@/ parameter can be 'P.Nothing'. In that case it will do
-- the verifications using GPG keys in the keyrings of all remotes.
-- 
-- /Since: 2016.6/
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 t'GI.GLib.Structs.Bytes.Bytes'
    -> GLib.Bytes.Bytes
    -- ^ /@signatures@/: Signatures as a t'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 t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
repoGpgVerifyData :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsFile c,
 IsCancellable d) =>
a
-> Maybe Text
-> Bytes
-> Bytes
-> Maybe b
-> Maybe c
-> Maybe d
-> m GpgVerifyResult
repoGpgVerifyData a
self Maybe Text
remoteName Bytes
data_ Bytes
signatures Maybe b
keyringdir Maybe c
extraKeyring Maybe d
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeRemoteName <- case remoteName of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jRemoteName -> do
            jRemoteName' <- Text -> IO CString
textToCString Text
jRemoteName
            return jRemoteName'
    data_' <- unsafeManagedPtrGetPtr data_
    signatures' <- unsafeManagedPtrGetPtr signatures
    maybeKeyringdir <- case keyringdir of
        Maybe b
Nothing -> Ptr File -> IO (Ptr File)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
FP.nullPtr
        Just b
jKeyringdir -> do
            jKeyringdir' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jKeyringdir
            return jKeyringdir'
    maybeExtraKeyring <- case extraKeyring of
        Maybe c
Nothing -> Ptr File -> IO (Ptr File)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
FP.nullPtr
        Just c
jExtraKeyring -> do
            jExtraKeyring' <- c -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jExtraKeyring
            return jExtraKeyring'
    maybeCancellable <- case cancellable of
        Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just d
jCancellable -> do
            jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
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
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoGpgVerifyDataMethodInfo a signature where
    overloadedMethod = repoGpgVerifyData

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


#endif

-- method Repo::has_object
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_have_object"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "%TRUE if repository contains object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.True' if /@self@/ contains the given object;
-- 'P.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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> ObjectType -> Text -> Maybe b -> m Bool
repoHasObject a
self ObjectType
objtype Text
checksum Maybe b
cancellable = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    checksum' <- textToCString checksum
    outHaveObject <- allocMem :: IO (Ptr CInt)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_has_object self' objtype' checksum' outHaveObject maybeCancellable
        outHaveObject' <- peek outHaveObject
        let outHaveObject'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outHaveObject'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        freeMem outHaveObject
        return outHaveObject''
     ) (do
        freeMem checksum'
        freeMem outHaveObject
     )

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

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


#endif

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

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

-- | Calculate a hash value for the given open repository, suitable for use when
-- putting it into a hash table. It is an error to call this on an t'GI.OSTree.Objects.Repo.Repo'
-- which is not yet open, as a persistent hash value cannot be calculated until
-- the repository is open and the inode of its root directory has been loaded.
-- 
-- This function does no I\/O.
-- 
-- /Since: 2017.12/
repoHash ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> m Word32
    -- ^ __Returns:__ hash value for the t'GI.OSTree.Objects.Repo.Repo'
repoHash :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m Word32
repoHash a
self = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_repo_hash self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data RepoHashMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsRepo a) => O.OverloadedMethod RepoHashMethodInfo a signature where
    overloadedMethod = repoHash

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


#endif

-- method Repo::import_object_from
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Destination repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Source repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsRepo b, IsCancellable c) =>
a -> b -> ObjectType -> Text -> Maybe c -> m ()
repoImportObjectFrom a
self b
source ObjectType
objtype Text
checksum Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    source' <- unsafeManagedPtrCastPtr source
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    checksum' <- textToCString checksum
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_import_object_from self' source' objtype' checksum' maybeCancellable
        touchManagedPtr self
        touchManagedPtr source
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

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

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


#endif

-- method Repo::import_object_from_with_trust
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Destination repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Source repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "trusted"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 /@trusted@/ is 'P.True' and 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.
-- 
-- /Since: 2016.5/
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 'P.True', assume the source repo is valid and trusted
    -> Maybe (c)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoImportObjectFromWithTrust :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsRepo b, IsCancellable c) =>
a -> b -> ObjectType -> Text -> Bool -> Maybe c -> m ()
repoImportObjectFromWithTrust a
self b
source ObjectType
objtype Text
checksum Bool
trusted Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    source' <- unsafeManagedPtrCastPtr source
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    checksum' <- textToCString checksum
    let trusted' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
trusted
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoImportObjectFromWithTrustMethodInfo a signature where
    overloadedMethod = repoImportObjectFromWithTrust

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


#endif

-- method Repo::is_system
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Repository" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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:__ 'P.True' if this repository is the root-owned system global repository
repoIsSystem :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m Bool
repoIsSystem a
repo = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    repo' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
    result <- ostree_repo_is_system repo'
    let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    touchManagedPtr repo
    return result'

#if defined(ENABLE_OVERLOADING)
data RepoIsSystemMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsRepo a) => O.OverloadedMethod RepoIsSystemMethodInfo a signature where
    overloadedMethod = repoIsSystem

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


#endif

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

foreign import ccall "ostree_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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m ()
repoIsWritable a
self = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    onException (do
        _ <- propagateGError $ ostree_repo_is_writable self'
        touchManagedPtr self
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoIsWritableMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepo a) => O.OverloadedMethod RepoIsWritableMethodInfo a signature where
    overloadedMethod = repoIsWritable

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


#endif

-- XXX Could not generate method Repo::list_collection_refs
-- Not implemented: GHashTable element of type TInterface (Name {namespace = "OSTree", name = "CollectionRef"}) unsupported.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoListCollectionRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listCollectionRefs" Repo) => O.OverloadedMethod RepoListCollectionRefsMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "listCollectionRefs" Repo) => O.OverloadedMethodInfo RepoListCollectionRefsMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Repo::list_commit_objects_starting_with
-- Not implemented: GHashTable element of type TVariant unsupported.
#if defined(ENABLE_OVERLOADING)
-- 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.UnsupportedMethodError "listCommitObjectsStartingWith" Repo) => O.OverloadedMethod RepoListCommitObjectsStartingWithMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "listCommitObjectsStartingWith" Repo) => O.OverloadedMethodInfo RepoListCommitObjectsStartingWithMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Repo::list_objects
-- Not implemented: GHashTable element of type TVariant unsupported.
#if defined(ENABLE_OVERLOADING)
-- 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.UnsupportedMethodError "listObjects" Repo) => O.OverloadedMethod RepoListObjectsMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "listObjects" Repo) => O.OverloadedMethodInfo RepoListObjectsMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Repo::list_refs
-- Not implemented: Hash table argument with transfer = Container? outAllRefs'
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoListRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listRefs" Repo) => O.OverloadedMethod RepoListRefsMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "listRefs" Repo) => O.OverloadedMethodInfo RepoListRefsMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Repo::list_refs_ext
-- Not implemented: Hash table argument with transfer = Container? outAllRefs'
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoListRefsExtMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "listRefsExt" Repo) => O.OverloadedMethod RepoListRefsExtMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "listRefsExt" Repo) => O.OverloadedMethodInfo RepoListRefsExtMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- method Repo::list_static_delta_indexes
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_indexes"
--           , argType = TPtrArray (TBasicType TUTF8)
--           , argCType = Just "GPtrArray**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "String name of delta indexes\n(checksum)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferContainer
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_list_static_delta_indexes" ostree_repo_list_static_delta_indexes :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr (Ptr (GPtrArray CString)) ->        -- out_indexes : 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 delta indexes in the
-- repository, returning its result in /@outIndexes@/.
-- 
-- /Since: 2020.8/
repoListStaticDeltaIndexes ::
    (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')/
repoListStaticDeltaIndexes :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m [Text]
repoListStaticDeltaIndexes a
self Maybe b
cancellable = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    outIndexes <- callocMem :: IO (Ptr (Ptr (GPtrArray CString)))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_list_static_delta_indexes self' outIndexes maybeCancellable
        outIndexes' <- peek outIndexes
        outIndexes'' <- unpackGPtrArray outIndexes'
        outIndexes''' <- mapM cstringToText outIndexes''
        unrefPtrArray outIndexes'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem outIndexes
        return outIndexes'''
     ) (do
        freeMem outIndexes
     )

#if defined(ENABLE_OVERLOADING)
data RepoListStaticDeltaIndexesMethodInfo
instance (signature ~ (Maybe (b) -> m ([T.Text])), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoListStaticDeltaIndexesMethodInfo a signature where
    overloadedMethod = repoListStaticDeltaIndexes

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


#endif

-- method Repo::list_static_delta_names
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_deltas"
--           , argType = TPtrArray (TBasicType TUTF8)
--           , argCType = Just "GPtrArray**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "String name of deltas\n(checksum-checksum.delta)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferContainer
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m [Text]
repoListStaticDeltaNames a
self Maybe b
cancellable = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    outDeltas <- callocMem :: IO (Ptr (Ptr (GPtrArray CString)))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::load_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Commit checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_commit"
--           , argType = TVariant
--           , argCType = Just "GVariant**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Commit" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_state"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoCommitState" }
--           , argCType = Just "OstreeRepoCommitState*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Commit state" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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.RepoCommitStatePartial', 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> m (GVariant, [RepoCommitState])
repoLoadCommit a
self Text
checksum = IO (GVariant, [RepoCommitState]) -> m (GVariant, [RepoCommitState])
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GVariant, [RepoCommitState])
 -> m (GVariant, [RepoCommitState]))
-> IO (GVariant, [RepoCommitState])
-> m (GVariant, [RepoCommitState])
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    checksum' <- textToCString checksum
    outCommit <- callocMem :: IO (Ptr (Ptr GVariant))
    outState <- allocMem :: IO (Ptr CUInt)
    onException (do
        _ <- propagateGError $ ostree_repo_load_commit self' checksum' outCommit outState
        outCommit' <- peek outCommit
        outCommit'' <- B.GVariant.wrapGVariantPtr outCommit'
        outState' <- peek outState
        let outState'' = CUInt -> [RepoCommitState]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
outState'
        touchManagedPtr self
        freeMem checksum'
        freeMem outCommit
        freeMem outState
        return (outCommit'', outState'')
     ) (do
        freeMem checksum'
        freeMem outCommit
        freeMem outState
     )

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

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


#endif

-- method Repo::load_file
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_input"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "File content" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_file_info"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "FileInfo" }
--           , argCType = Just "GFileInfo**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "File information" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_xattrs"
--           , argType = TVariant
--           , argCType = Just "GVariant**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Extended attributes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 ((Maybe Gio.InputStream.InputStream, Maybe Gio.FileInfo.FileInfo, Maybe GVariant))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoLoadFile :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> Text
-> Maybe b
-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
repoLoadFile a
self Text
checksum Maybe b
cancellable = IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
 -> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant))
-> IO (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    checksum' <- textToCString checksum
    outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream))
    outFileInfo <- callocMem :: IO (Ptr (Ptr Gio.FileInfo.FileInfo))
    outXattrs <- callocMem :: IO (Ptr (Ptr GVariant))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_load_file self' checksum' outInput outFileInfo outXattrs maybeCancellable
        outInput' <- peek outInput
        maybeOutInput' <- convertIfNonNull outInput' $ \Ptr InputStream
outInput'' -> do
            outInput''' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
outInput''
            return outInput'''
        outFileInfo' <- peek outFileInfo
        maybeOutFileInfo' <- convertIfNonNull outFileInfo' $ \Ptr FileInfo
outFileInfo'' -> do
            outFileInfo''' <- ((ManagedPtr FileInfo -> FileInfo) -> Ptr FileInfo -> IO FileInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
outFileInfo''
            return outFileInfo'''
        outXattrs' <- peek outXattrs
        maybeOutXattrs' <- convertIfNonNull outXattrs' $ \Ptr GVariant
outXattrs'' -> do
            outXattrs''' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outXattrs''
            return outXattrs'''
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        freeMem outInput
        freeMem outFileInfo
        freeMem outXattrs
        return (maybeOutInput', maybeOutFileInfo', maybeOutXattrs')
     ) (do
        freeMem checksum'
        freeMem outInput
        freeMem outFileInfo
        freeMem outXattrs
     )

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

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


#endif

-- method Repo::load_object_stream
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_input"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Stream for object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_size"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Length of @out_input"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> ObjectType -> Text -> Maybe b -> m (InputStream, Word64)
repoLoadObjectStream a
self ObjectType
objtype Text
checksum Maybe b
cancellable = IO (InputStream, Word64) -> m (InputStream, Word64)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (InputStream, Word64) -> m (InputStream, Word64))
-> IO (InputStream, Word64) -> m (InputStream, Word64)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    checksum' <- textToCString checksum
    outInput <- callocMem :: IO (Ptr (Ptr Gio.InputStream.InputStream))
    outSize <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoLoadObjectStreamMethodInfo a signature where
    overloadedMethod = repoLoadObjectStream

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


#endif

-- method Repo::load_variant
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Expected object type"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sha256"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Checksum string" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_variant"
--           , argType = TVariant
--           , argCType = Just "GVariant**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Metadata object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> ObjectType -> Text -> m GVariant
repoLoadVariant a
self ObjectType
objtype Text
sha256 = IO GVariant -> m GVariant
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    sha256' <- textToCString sha256
    outVariant <- callocMem :: IO (Ptr (Ptr GVariant))
    onException (do
        _ <- propagateGError $ ostree_repo_load_variant self' objtype' sha256' outVariant
        outVariant' <- peek outVariant
        outVariant'' <- B.GVariant.wrapGVariantPtr outVariant'
        touchManagedPtr self
        freeMem sha256'
        freeMem outVariant
        return outVariant''
     ) (do
        freeMem sha256'
        freeMem outVariant
     )

#if defined(ENABLE_OVERLOADING)
data RepoLoadVariantMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> m (GVariant)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoLoadVariantMethodInfo a signature where
    overloadedMethod = repoLoadVariant

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


#endif

-- method Repo::load_variant_if_exists
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sha256"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_variant"
--           , argType = TVariant
--           , argCType = Just "GVariant**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Metadata" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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,
-- /@outVariant@/ will be set to 'P.Nothing' and the function will still
-- return TRUE.
repoLoadVariantIfExists ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> OSTree.Enums.ObjectType
    -- ^ /@objtype@/: Object type
    -> T.Text
    -- ^ /@sha256@/: ASCII checksum
    -> m ((Maybe GVariant))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoLoadVariantIfExists :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> ObjectType -> Text -> m (Maybe GVariant)
repoLoadVariantIfExists a
self ObjectType
objtype Text
sha256 = IO (Maybe GVariant) -> m (Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    sha256' <- textToCString sha256
    outVariant <- callocMem :: IO (Ptr (Ptr GVariant))
    onException (do
        _ <- propagateGError $ ostree_repo_load_variant_if_exists self' objtype' sha256' outVariant
        outVariant' <- peek outVariant
        maybeOutVariant' <- convertIfNonNull outVariant' $ \Ptr GVariant
outVariant'' -> do
            outVariant''' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outVariant''
            return outVariant'''
        touchManagedPtr self
        freeMem sha256'
        freeMem outVariant
        return maybeOutVariant'
     ) (do
        freeMem sha256'
        freeMem outVariant
     )

#if defined(ENABLE_OVERLOADING)
data RepoLoadVariantIfExistsMethodInfo
instance (signature ~ (OSTree.Enums.ObjectType -> T.Text -> m ((Maybe GVariant))), MonadIO m, IsRepo a) => O.OverloadedMethod RepoLoadVariantIfExistsMethodInfo a signature where
    overloadedMethod = repoLoadVariantIfExists

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


#endif

-- method Repo::lock_pop
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "lock_type"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoLockType" }
--           , argCType = Just "OstreeRepoLockType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the type of lock to release"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_lock_pop" ostree_repo_lock_pop :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- lock_type : TInterface (Name {namespace = "OSTree", name = "RepoLockType"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Release a lock of type /@lockType@/ from the lock state. If the lock state
-- becomes empty, the repository is unlocked. Otherwise, the lock state only
-- changes when transitioning from an exclusive lock back to a shared lock. The
-- requested /@lockType@/ must be the same type that was requested in the call to
-- 'GI.OSTree.Objects.Repo.repoLockPush'. It is a programmer error if these do not match and
-- the program may abort if the lock would reach an invalid state.
-- 
-- 'GI.OSTree.Objects.Repo.repoLockPop' waits for the lock depending on the repository\'s
-- lock-timeout-secs configuration. When lock-timeout-secs is -1, a blocking lock is
-- attempted. Otherwise, the lock is removed non-blocking and
-- 'GI.OSTree.Objects.Repo.repoLockPop' will sleep synchronously up to lock-timeout-secs seconds
-- attempting to remove the lock. If the lock cannot be removed within the
-- timeout, a 'GI.Gio.Enums.IOErrorEnumWouldBlock' error is returned.
-- 
-- If /@self@/ is not writable by the user, then no unlocking is attempted and
-- 'P.True' is returned.
-- 
-- /Since: 2021.3/
repoLockPop ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: a t'GI.OSTree.Objects.Repo.Repo'
    -> OSTree.Enums.RepoLockType
    -- ^ /@lockType@/: the type of lock to release
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoLockPop :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> RepoLockType -> Maybe b -> m ()
repoLockPop a
self RepoLockType
lockType Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let lockType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RepoLockType -> Int) -> RepoLockType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoLockType -> Int
forall a. Enum a => a -> Int
fromEnum) RepoLockType
lockType
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_lock_pop self' lockType' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoLockPopMethodInfo
instance (signature ~ (OSTree.Enums.RepoLockType -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoLockPopMethodInfo a signature where
    overloadedMethod = repoLockPop

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


#endif

-- method Repo::lock_push
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "lock_type"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoLockType" }
--           , argCType = Just "OstreeRepoLockType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the type of lock to acquire"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_lock_push" ostree_repo_lock_push :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- lock_type : TInterface (Name {namespace = "OSTree", name = "RepoLockType"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Takes a lock on the repository and adds it to the lock state. If /@lockType@/
-- is 'GI.OSTree.Enums.RepoLockTypeShared', a shared lock is taken. If /@lockType@/ is
-- 'GI.OSTree.Enums.RepoLockTypeExclusive', an exclusive lock is taken. The actual lock
-- state is only changed when locking a previously unlocked repository or
-- upgrading the lock from shared to exclusive. If the requested lock type is
-- unchanged or would represent a downgrade (exclusive to shared), the lock
-- state is not changed.
-- 
-- 'GI.OSTree.Objects.Repo.repoLockPush' waits for the lock depending on the repository\'s
-- lock-timeout-secs configuration. When lock-timeout-secs is -1, a blocking lock is
-- attempted. Otherwise, the lock is taken non-blocking and
-- 'GI.OSTree.Objects.Repo.repoLockPush' will sleep synchronously up to lock-timeout-secs seconds
-- attempting to acquire the lock. If the lock cannot be acquired within the
-- timeout, a 'GI.Gio.Enums.IOErrorEnumWouldBlock' error is returned.
-- 
-- If /@self@/ is not writable by the user, then no locking is attempted and
-- 'P.True' is returned.
-- 
-- /Since: 2021.3/
repoLockPush ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: a t'GI.OSTree.Objects.Repo.Repo'
    -> OSTree.Enums.RepoLockType
    -- ^ /@lockType@/: the type of lock to acquire
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoLockPush :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> RepoLockType -> Maybe b -> m ()
repoLockPush a
self RepoLockType
lockType Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let lockType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RepoLockType -> Int) -> RepoLockType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoLockType -> Int
forall a. Enum a => a -> Int
fromEnum) RepoLockType
lockType
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_lock_push self' lockType' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoLockPushMethodInfo
instance (signature ~ (OSTree.Enums.RepoLockType -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoLockPushMethodInfo a signature where
    overloadedMethod = repoLockPush

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


#endif

-- method Repo::mark_commit_partial
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Commit SHA-256" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "is_partial"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Whether or not this commit is partial"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_mark_commit_partial" ostree_repo_mark_commit_partial :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- checksum : TBasicType TUTF8
    CInt ->                                 -- is_partial : TBasicType TBoolean
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Commits in the \"partial\" state do not have all their child objects
-- written.  This occurs in various situations, such as during a pull,
-- but also if a \"subpath\" pull is used, as well as \"commit only\"
-- pulls.
-- 
-- This function is used by 'GI.OSTree.Objects.Repo.repoPullWithOptions'; you
-- should use this if you are implementing a different type of transport.
-- 
-- /Since: 2017.15/
repoMarkCommitPartial ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> T.Text
    -- ^ /@checksum@/: Commit SHA-256
    -> Bool
    -- ^ /@isPartial@/: Whether or not this commit is partial
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoMarkCommitPartial :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Bool -> m ()
repoMarkCommitPartial a
self Text
checksum Bool
isPartial = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    checksum' <- textToCString checksum
    let isPartial' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
isPartial
    onException (do
        _ <- propagateGError $ ostree_repo_mark_commit_partial self' checksum' isPartial'
        touchManagedPtr self
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

#if defined(ENABLE_OVERLOADING)
data RepoMarkCommitPartialMethodInfo
instance (signature ~ (T.Text -> Bool -> m ()), MonadIO m, IsRepo a) => O.OverloadedMethod RepoMarkCommitPartialMethodInfo a signature where
    overloadedMethod = repoMarkCommitPartial

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


#endif

-- method Repo::mark_commit_partial_reason
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Commit SHA-256" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "is_partial"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Whether or not this commit is partial"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "in_state"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoCommitState" }
--           , argCType = Just "OstreeRepoCommitState"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Reason bitmask for partial commit"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_mark_commit_partial_reason" ostree_repo_mark_commit_partial_reason :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- checksum : TBasicType TUTF8
    CInt ->                                 -- is_partial : TBasicType TBoolean
    CUInt ->                                -- in_state : TInterface (Name {namespace = "OSTree", name = "RepoCommitState"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Allows the setting of a reason code for a partial commit. Presently
-- it only supports setting reason bitmask to
-- OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL, or
-- OSTREE_REPO_COMMIT_STATE_NORMAL.  This will allow successive ostree
-- fsck operations to exit properly with an error code if the
-- repository has been truncated as a result of fsck trying to repair
-- it.
-- 
-- /Since: 2019.4/
repoMarkCommitPartialReason ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> T.Text
    -- ^ /@checksum@/: Commit SHA-256
    -> Bool
    -- ^ /@isPartial@/: Whether or not this commit is partial
    -> [OSTree.Flags.RepoCommitState]
    -- ^ /@inState@/: Reason bitmask for partial commit
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoMarkCommitPartialReason :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Bool -> [RepoCommitState] -> m ()
repoMarkCommitPartialReason a
self Text
checksum Bool
isPartial [RepoCommitState]
inState = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    checksum' <- textToCString checksum
    let isPartial' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
isPartial
    let inState' = [RepoCommitState] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoCommitState]
inState
    onException (do
        _ <- propagateGError $ ostree_repo_mark_commit_partial_reason self' checksum' isPartial' inState'
        touchManagedPtr self
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

#if defined(ENABLE_OVERLOADING)
data RepoMarkCommitPartialReasonMethodInfo
instance (signature ~ (T.Text -> Bool -> [OSTree.Flags.RepoCommitState] -> m ()), MonadIO m, IsRepo a) => O.OverloadedMethod RepoMarkCommitPartialReasonMethodInfo a signature where
    overloadedMethod = repoMarkCommitPartialReason

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


#endif

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

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m ()
repoOpen a
self Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_open self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoOpenMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoOpenMethodInfo a signature where
    overloadedMethod = repoOpen

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


#endif

-- method Repo::prepare_transaction
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_transaction_resume"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 may result in partial commits or data in the target
-- repository if interrupted during 'GI.OSTree.Objects.Repo.repoCommitTransaction', and
-- further writing refs is also not currently atomic.
-- 
-- There can be at most one transaction active on a repo at a time per instance
-- of @OstreeRepo@; however, it is safe to have multiple threads writing objects
-- on a single @OstreeRepo@ instance as long as their lifetime is bounded by the
-- transaction.
-- 
-- Locking: Acquires a @shared@ lock; release via commit or abort
-- Multithreading: This function is *not* MT safe; only one transaction can be
-- active at a time.
repoPrepareTransaction ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m (Bool)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoPrepareTransaction :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m Bool
repoPrepareTransaction a
self Maybe b
cancellable = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    outTransactionResume <- allocMem :: IO (Ptr CInt)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_prepare_transaction self' outTransactionResume maybeCancellable
        outTransactionResume' <- peek outTransactionResume
        let outTransactionResume'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outTransactionResume'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem outTransactionResume
        return outTransactionResume''
     ) (do
        freeMem outTransactionResume
     )

#if defined(ENABLE_OVERLOADING)
data RepoPrepareTransactionMethodInfo
instance (signature ~ (Maybe (b) -> m (Bool)), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoPrepareTransactionMethodInfo a signature where
    overloadedMethod = repoPrepareTransaction

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


#endif

-- method Repo::prune
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoPruneFlags" }
--           , argCType = Just "OstreeRepoPruneFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Options controlling prune process"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "depth"
--           , argType = TBasicType TInt
--           , argCType = Just "gint"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_objects_total"
--           , argType = TBasicType TInt
--           , argCType = Just "gint*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of objects found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_objects_pruned"
--           , argType = TBasicType TInt
--           , argCType = Just "gint*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of objects deleted"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_pruned_object_size_total"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.Flags.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.Flags.RepoPruneFlagsNoPrune' to just determine
-- statistics on objects that would be deleted, without actually
-- deleting them.
-- 
-- Locking: exclusive
repoPrune ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: Repo
    -> [OSTree.Flags.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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> [RepoPruneFlags] -> Int32 -> Maybe b -> m (Int32, Int32, Word64)
repoPrune a
self [RepoPruneFlags]
flags Int32
depth Maybe b
cancellable = IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64))
-> IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let flags' = [RepoPruneFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoPruneFlags]
flags
    outObjectsTotal <- allocMem :: IO (Ptr Int32)
    outObjectsPruned <- allocMem :: IO (Ptr Int32)
    outPrunedObjectSizeTotal <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

#if defined(ENABLE_OVERLOADING)
data RepoPruneMethodInfo
instance (signature ~ ([OSTree.Flags.RepoPruneFlags] -> Int32 -> Maybe (b) -> m ((Int32, Int32, Word64))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoPruneMethodInfo a signature where
    overloadedMethod = repoPrune

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


#endif

-- method Repo::prune_from_reachable
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoPruneOptions" }
--           , argCType = Just "OstreeRepoPruneOptions*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Options controlling prune process"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_objects_total"
--           , argType = TBasicType TInt
--           , argCType = Just "gint*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of objects found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_objects_pruned"
--           , argType = TBasicType TInt
--           , argCType = Just "gint*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of objects deleted"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_pruned_object_size_total"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.Flags.RepoPruneFlagsNoPrune' flag may be specified to just determine
-- statistics on objects that would be deleted, without actually deleting them.
-- 
-- Locking: exclusive
-- 
-- /Since: 2017.1/
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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> RepoPruneOptions -> Maybe b -> m (Int32, Int32, Word64)
repoPruneFromReachable a
self RepoPruneOptions
options Maybe b
cancellable = IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64))
-> IO (Int32, Int32, Word64) -> m (Int32, Int32, Word64)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    options' <- unsafeManagedPtrGetPtr options
    outObjectsTotal <- allocMem :: IO (Ptr Int32)
    outObjectsPruned <- allocMem :: IO (Ptr Int32)
    outPrunedObjectSizeTotal <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::prune_static_deltas
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.
-- 
-- Locking: exclusive
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 'P.Nothing' for each
    -- non existing commit
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoPruneStaticDeltas :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe Text -> Maybe b -> m ()
repoPruneStaticDeltas a
self Maybe Text
commit Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCommit <- case commit of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jCommit -> do
            jCommit' <- Text -> IO CString
textToCString Text
jCommit
            return jCommit'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_prune_static_deltas self' maybeCommit maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem maybeCommit
        return ()
     ) (do
        freeMem maybeCommit
     )

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

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


#endif

-- method Repo::pull
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refs_to_fetch"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "char**"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Optional list of\nrefs; if %NULL, fetch all configured refs"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoPullFlags" }
--           , argCType = Just "OstreeRepoPullFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Options controlling fetch behavior"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Progress" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.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 'P.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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b,
 IsCancellable c) =>
a
-> Text
-> Maybe [Text]
-> [RepoPullFlags]
-> Maybe b
-> Maybe c
-> m ()
repoPull a
self Text
remoteName Maybe [Text]
refsToFetch [RepoPullFlags]
flags Maybe b
progress Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteName' <- textToCString remoteName
    maybeRefsToFetch <- case refsToFetch of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
FP.nullPtr
        Just [Text]
jRefsToFetch -> do
            jRefsToFetch' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jRefsToFetch
            return jRefsToFetch'
    let flags' = [RepoPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoPullFlags]
flags
    maybeProgress <- case progress of
        Maybe b
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr
        Just b
jProgress -> do
            jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoPullMethodInfo a signature where
    overloadedMethod = repoPull

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


#endif

-- method Repo::pull_from_remotes_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "results"
--           , argType =
--               TCArray
--                 True
--                 (-1)
--                 (-1)
--                 (TInterface
--                    Name { namespace = "OSTree" , name = "RepoFinderResult" })
--           , argCType = Just "const OstreeRepoFinderResult* const*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "%NULL-terminated array of remotes to\n   pull from, including the refs to pull from each"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "an #OstreeAsyncProgress to update with the operation\8217s\n   progress, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , argCType = Just "GAsyncReadyCallback"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "asynchronous completion callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 6
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_pull_from_remotes_async" ostree_repo_pull_from_remotes_async :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr (Ptr OSTree.RepoFinderResult.RepoFinderResult) -> -- results : TCArray True (-1) (-1) (TInterface (Name {namespace = "OSTree", name = "RepoFinderResult"}))
    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"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Pull refs from multiple remotes which have been found using
-- 'GI.OSTree.Objects.Repo.repoFindRemotesAsync'.
-- 
-- /@results@/ are expected to be in priority order, with the best remotes to pull
-- from listed first. 'GI.OSTree.Objects.Repo.repoPullFromRemotesAsync' will generally pull
-- from the remotes in order, but may parallelise its downloads.
-- 
-- If an error is encountered when pulling from a given remote, that remote will
-- be ignored and another will be tried instead. If any refs have not been
-- downloaded successfully after all remotes have been tried, 'GI.Gio.Enums.IOErrorEnumFailed'
-- will be returned. The results of any successful downloads will remain cached
-- in the local repository.
-- 
-- If /@cancellable@/ is cancelled, 'GI.Gio.Enums.IOErrorEnumCancelled' will be returned
-- immediately. The results of any successfully completed downloads at that
-- point will remain cached in the local repository.
-- 
-- GPG verification of commits will be used unconditionally.
-- 
-- The following /@options@/ are currently defined:
-- 
--   * @flags@ (@i@): t'GI.OSTree.Flags.RepoPullFlags' to apply to the pull operation
--   * @inherit-transaction@ (@b@): 'P.True' to inherit an ongoing transaction on
--     the t'GI.OSTree.Objects.Repo.Repo', rather than encapsulating the pull in a new one
--   * @depth@ (@i@): How far in the history to traverse; default is 0, -1 means infinite
--   * @disable-static-deltas@ (@b@): Do not use static deltas
--   * @http-headers@ (@a(ss)@): Additional headers to add to all HTTP requests
--   * @subdirs@ (@as@): Pull just these subdirectories
--   * @update-frequency@ (@u@): Frequency to call the async progress callback in
--     milliseconds, if any; only values higher than 0 are valid
--   * @append-user-agent@ (@s@): Additional string to append to the user agent
--   * @n-network-retries@ (@u@): Number of times to retry each download on receiving
--     a transient network error, such as a socket timeout; default is 5, 0
--     means return errors without retrying. Since: 2018.6
--   * @ref-keyring-map@ (@a(sss)@): Array of (collection ID, ref name, keyring
--     remote name) tuples specifying which remote\'s keyring should be used when
--     doing GPG verification of each collection-ref. This is useful to prevent a
--     remote from serving malicious updates to refs which did not originate from
--     it. This can be a subset or superset of the refs being pulled; any ref
--     not being pulled will be ignored and any ref without a keyring remote
--     will be verified with the keyring of the remote being pulled from.
--     Since: 2019.2
-- 
-- /Since: 2018.6/
repoPullFromRemotesAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> [OSTree.RepoFinderResult.RepoFinderResult]
    -- ^ /@results@/: 'P.Nothing'-terminated array of remotes to
    --    pull from, including the refs to pull from each
    -> Maybe (GVariant)
    -- ^ /@options@/: A GVariant @a{sv}@ with an extensible set of flags
    -> Maybe (b)
    -- ^ /@progress@/: an t'GI.OSTree.Objects.AsyncProgress.AsyncProgress' to update with the operation’s
    --    progress, or 'P.Nothing'
    -> Maybe (c)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: asynchronous completion callback
    -> m ()
repoPullFromRemotesAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b,
 IsCancellable c) =>
a
-> [RepoFinderResult]
-> Maybe GVariant
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoPullFromRemotesAsync a
self [RepoFinderResult]
results Maybe GVariant
options Maybe b
progress Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    results' <- mapM unsafeManagedPtrGetPtr results
    results'' <- packZeroTerminatedPtrArray results'
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    maybeProgress <- case progress of
        Maybe b
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr
        Just b
jProgress -> do
            jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    maybeCallback <- case callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = Ptr a
forall a. Ptr a
nullPtr
    ostree_repo_pull_from_remotes_async self' results'' maybeOptions maybeProgress maybeCancellable maybeCallback userData
    touchManagedPtr self
    mapM_ touchManagedPtr results
    whenJust options touchManagedPtr
    whenJust progress touchManagedPtr
    whenJust cancellable touchManagedPtr
    freeMem results''
    return ()

#if defined(ENABLE_OVERLOADING)
data RepoPullFromRemotesAsyncMethodInfo
instance (signature ~ ([OSTree.RepoFinderResult.RepoFinderResult] -> Maybe (GVariant) -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsRepo a, OSTree.AsyncProgress.IsAsyncProgress b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod RepoPullFromRemotesAsyncMethodInfo a signature where
    overloadedMethod = repoPullFromRemotesAsync

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


#endif

-- method Repo::pull_from_remotes_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , argCType = Just "GAsyncResult*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the asynchronous result"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_pull_from_remotes_finish" ostree_repo_pull_from_remotes_finish :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Finish an asynchronous pull operation started with
-- 'GI.OSTree.Objects.Repo.repoPullFromRemotesAsync'.
-- 
-- /Since: 2018.6/
repoPullFromRemotesFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> b
    -- ^ /@result@/: the asynchronous result
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoPullFromRemotesFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) =>
a -> b -> m ()
repoPullFromRemotesFinish a
self b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ ostree_repo_pull_from_remotes_finish self' result_'
        touchManagedPtr self
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoPullFromRemotesFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod RepoPullFromRemotesFinishMethodInfo a signature where
    overloadedMethod = repoPullFromRemotesFinish

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


#endif

-- method Repo::pull_one_dir
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dir_to_pull"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Subdirectory path" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refs_to_fetch"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "char**"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Optional list of\nrefs; if %NULL, fetch all configured refs"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoPullFlags" }
--           , argCType = Just "OstreeRepoPullFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Options controlling fetch behavior"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Progress" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b,
 IsCancellable c) =>
a
-> Text
-> Text
-> Maybe [Text]
-> [RepoPullFlags]
-> Maybe b
-> Maybe c
-> m ()
repoPullOneDir a
self Text
remoteName Text
dirToPull Maybe [Text]
refsToFetch [RepoPullFlags]
flags Maybe b
progress Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteName' <- textToCString remoteName
    dirToPull' <- textToCString dirToPull
    maybeRefsToFetch <- case refsToFetch of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
FP.nullPtr
        Just [Text]
jRefsToFetch -> do
            jRefsToFetch' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jRefsToFetch
            return jRefsToFetch'
    let flags' = [RepoPullFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoPullFlags]
flags
    maybeProgress <- case progress of
        Maybe b
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr
        Just b
jProgress -> do
            jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoPullOneDirMethodInfo a signature where
    overloadedMethod = repoPullOneDir

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


#endif

-- method Repo::pull_with_options
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name_or_baseurl"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote or file:// url"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "AsyncProgress" }
--           , argCType = Just "OstreeAsyncProgress*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Progress" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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
--   * @collection-refs@ (@a(sss)@): Array of (collection ID, ref name, checksum) tuples to pull;
--     mutually exclusive with @refs@ and @override-commit-ids@. Checksums may be the empty
--     string to pull the latest commit for that ref
--   * @flags@ (@i@): An instance of t'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
--   * @disable-sign-verify@ (@b@): Disable signapi verification of commits
--   * @disable-sign-verify-summary@ (@b@): Disable signapi verification of the summary
--   * @depth@ (@i@): How far in the history to traverse; default is 0, -1 means infinite
--   * @per-object-fsync@ (@b@): Perform disk writes more slowly, avoiding a single large I\/O sync
--   * @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
--   * @timestamp-check@ (@b@): Verify commit timestamps are newer than current (when pulling via
-- ref); Since: 2017.11
--   * @timestamp-check-from-rev@ (@s@): Verify that all fetched commit timestamps are newer than
-- timestamp of given rev; Since: 2020.4
--   * @max-metadata-size@ (@t@): Restrict metadata objects to a maximum number of bytes; 0 to
-- disable.  Since: 2018.9
--   * @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, useful to do
-- multiple 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
--   * @localcache-repos@ (@as@): File paths for local repos to use as caches when doing remote
-- fetches
--   * @append-user-agent@ (@s@): Additional string to append to the user agent
--   * @n-network-retries@ (@u@): Number of times to retry each download on receiving
--     a transient network error, such as a socket timeout; default is 5, 0
--     means return errors without retrying. Since: 2018.6
--   * @low-speed-limit-bytes@ (@u@): The average transfer speed per second of a transfer
--      during the time set via \"low-speed-time-seconds\" for libcurl to abort.
--   * @low-speed-time-seconds@ (@u@): The time in number seconds that the transfer
--      speed should be below the \"low-speed-limit-bytes\" setting for libcurl to abort.
--   * @retry-all-network-errors@ (@b@): Retry when network issues happen, instead of
--      failing automatically. Currently only affects libcurl. (Default set to true)
--   * @max-outstanding-fetcher-requests@ (@u@): The max amount of concurrent connections allowed.
--   * @ref-keyring-map@ (@a(sss)@): Array of (collection ID, ref name, keyring
--     remote name) tuples specifying which remote\'s keyring should be used when
--     doing GPG verification of each collection-ref. This is useful to prevent a
--     remote from serving malicious updates to refs which did not originate from
--     it. This can be a subset or superset of the refs being pulled; any ref
--     not being pulled will be ignored and any ref without a keyring remote
--     will be verified with the keyring of the remote being pulled from.
--     Since: 2019.2
--   * @summary-bytes@ (@ay\'): Contents of the @summary@ file to use. If this is
--     specified, @summary-sig-bytes@ must also be specified. This is
--     useful if doing multiple pull operations in a transaction, using
--     ostree_repo_remote_fetch_summary_with_options() beforehand to download
--     the @summary@ and @summary.sig@ once for the entire transaction. If not
--     specified, the @summary@ will be downloaded from the remote. Since: 2020.5
--   * @summary-sig-bytes@ (@ay@): Contents of the @summary.sig@ file. If this
--     is specified, @summary-bytes@ must also be specified. Since: 2020.5
--   * @disable-verify-bindings@ (@b\`): Disable verification of commit bindings.
--     Since: 2020.9
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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b,
 IsCancellable c) =>
a -> Text -> GVariant -> Maybe b -> Maybe c -> m ()
repoPullWithOptions a
self Text
remoteNameOrBaseurl GVariant
options Maybe b
progress Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteNameOrBaseurl' <- textToCString remoteNameOrBaseurl
    options' <- unsafeManagedPtrGetPtr options
    maybeProgress <- case progress of
        Maybe b
Nothing -> Ptr AsyncProgress -> IO (Ptr AsyncProgress)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AsyncProgress
forall a. Ptr a
FP.nullPtr
        Just b
jProgress -> do
            jProgress' <- b -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProgress
            return jProgress'
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoPullWithOptionsMethodInfo a signature where
    overloadedMethod = repoPullWithOptions

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


#endif

-- method Repo::query_object_storage_size
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sha256"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_size"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Size in bytes object occupies physically"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> ObjectType -> Text -> Maybe b -> m Word64
repoQueryObjectStorageSize a
self ObjectType
objtype Text
sha256 Maybe b
cancellable = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    sha256' <- textToCString sha256
    outSize <- allocMem :: IO (Ptr Word64)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::read_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ref"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Ref or ASCII checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_root"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepoFile corresponding to the root"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The resolved commit checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe b -> m (File, Text)
repoReadCommit a
self Text
ref Maybe b
cancellable = IO (File, Text) -> m (File, Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (File, Text) -> m (File, Text))
-> IO (File, Text) -> m (File, Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    ref' <- textToCString ref
    outRoot <- callocMem :: IO (Ptr (Ptr Gio.File.File))
    outCommit <- callocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::read_commit_detached_metadata
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 commit checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_metadata"
--           , argType = TVariant
--           , argCType = Just "GVariant**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Metadata associated with commit in with format\n\"a{sv}\", or %NULL if none exists"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.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 ((Maybe GVariant))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoReadCommitDetachedMetadata :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe b -> m (Maybe GVariant)
repoReadCommitDetachedMetadata a
self Text
checksum Maybe b
cancellable = IO (Maybe GVariant) -> m (Maybe GVariant)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe GVariant) -> m (Maybe GVariant))
-> IO (Maybe GVariant) -> m (Maybe GVariant)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    checksum' <- textToCString checksum
    outMetadata <- callocMem :: IO (Ptr (Ptr GVariant))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_read_commit_detached_metadata self' checksum' outMetadata maybeCancellable
        outMetadata' <- peek outMetadata
        maybeOutMetadata' <- convertIfNonNull outMetadata' $ \Ptr GVariant
outMetadata'' -> do
            outMetadata''' <- Ptr GVariant -> IO GVariant
B.GVariant.wrapGVariantPtr Ptr GVariant
outMetadata''
            return outMetadata'''
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        freeMem outMetadata
        return maybeOutMetadata'
     ) (do
        freeMem checksum'
        freeMem outMetadata
     )

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

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


#endif

-- method Repo::regenerate_metadata
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "additional_metadata"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A GVariant `a{sv}`, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

-- | Regenerate the OSTree repository metadata used by clients to describe
-- available branches and other metadata.
-- 
-- The repository metadata currently consists of the @summary@ file. See
-- 'GI.OSTree.Objects.Repo.repoRegenerateSummary' and @/OSTREE_SUMMARY_GVARIANT_FORMAT/@ for
-- additional details on its contents.
-- 
-- Additionally, if the @core\/collection-id@ key is set in the configuration, a
-- 'GI.OSTree.Constants.REPO_METADATA_REF' commit will be created.
-- 
-- The following /@options@/ are currently defined:
-- 
--   * @gpg-key-ids@ (@as@): Array of GPG key IDs to sign the metadata with.
--   * @gpg-homedir@ (@s@): GPG home directory.
--   * @sign-keys@ (@av@): Array of keys to sign the metadata with. The key
--   type is specific to the sign engine used.
--   * @sign-type@ (@s@): Sign engine type to use. If not specified,
--   'GI.OSTree.Constants.SIGN_NAME_ED25519' is used.
-- 
-- Locking: shared
-- 
-- /Since: 2023.1/
repoRegenerateMetadata ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: Repo
    -> Maybe (GVariant)
    -- ^ /@additionalMetadata@/: A GVariant @a{sv}@, or 'P.Nothing'
    -> Maybe (GVariant)
    -- ^ /@options@/: A GVariant @a{sv}@ with an extensible set of flags
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoRegenerateMetadata :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe GVariant -> Maybe GVariant -> Maybe b -> m ()
repoRegenerateMetadata a
self Maybe GVariant
additionalMetadata Maybe GVariant
options Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeAdditionalMetadata <- case additionalMetadata of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jAdditionalMetadata -> do
            jAdditionalMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jAdditionalMetadata
            return jAdditionalMetadata'
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_regenerate_metadata self' maybeAdditionalMetadata maybeOptions maybeCancellable
        touchManagedPtr self
        whenJust additionalMetadata touchManagedPtr
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoRegenerateMetadataMethodInfo
instance (signature ~ (Maybe (GVariant) -> Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoRegenerateMetadataMethodInfo a signature where
    overloadedMethod = repoRegenerateMetadata

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


#endif

-- method Repo::regenerate_summary
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "additional_metadata"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.
-- 
-- If the timetable for making commits and updating the summary file is fairly
-- regular, setting the @ostree.summary.expires@ key in /@additionalMetadata@/
-- will aid clients in working out when to check for updates.
-- 
-- It is regenerated automatically after any ref is
-- added, removed, or updated if @core\/auto-update-summary@ is set.
-- 
-- If the @core\/collection-id@ key is set in the configuration, it will be
-- included as @/OSTREE_SUMMARY_COLLECTION_ID/@ in the summary file. Refs that
-- have associated collection IDs will be included in the generated summary
-- file, listed under the @/OSTREE_SUMMARY_COLLECTION_MAP/@ key. Collection IDs
-- and refs in @/OSTREE_SUMMARY_COLLECTION_MAP/@ are guaranteed to be in
-- lexicographic order.
-- 
-- Locking: shared (Prior to 2021.7, this was exclusive)
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 'P.Nothing'
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoRegenerateSummary :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe GVariant -> Maybe b -> m ()
repoRegenerateSummary a
self Maybe GVariant
additionalMetadata Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeAdditionalMetadata <- case additionalMetadata of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jAdditionalMetadata -> do
            jAdditionalMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jAdditionalMetadata
            return jAdditionalMetadata'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_regenerate_summary self' maybeAdditionalMetadata maybeCancellable
        touchManagedPtr self
        whenJust additionalMetadata touchManagedPtr
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoRegenerateSummaryMethodInfo
instance (signature ~ (Maybe (GVariant) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoRegenerateSummaryMethodInfo a signature where
    overloadedMethod = repoRegenerateSummary

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


#endif

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

foreign import ccall "ostree_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 t'GI.OSTree.Objects.Repo.Repo' will cache the remote configuration and its
-- own repo\/config data.  This API can be used to reload it.
-- 
-- /Since: 2017.2/
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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m ()
repoReloadConfig a
self Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_reload_config self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoReloadConfigMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoReloadConfigMethodInfo a signature where
    overloadedMethod = repoReloadConfig

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


#endif

-- method Repo::remote_add
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "url"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GVariant of type a{sv}"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 t'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
    -> Maybe (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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe Text -> Maybe GVariant -> Maybe b -> m ()
repoRemoteAdd a
self Text
name Maybe Text
url Maybe GVariant
options Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    name' <- textToCString name
    maybeUrl <- case url of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jUrl -> do
            jUrl' <- Text -> IO CString
textToCString Text
jUrl
            return jUrl'
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_add self' name' maybeUrl maybeOptions maybeCancellable
        touchManagedPtr self
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem name'
        freeMem maybeUrl
        return ()
     ) (do
        freeMem name'
        freeMem maybeUrl
     )

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

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


#endif

-- method Repo::remote_change
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sysroot"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "System root" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "changeop"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoRemoteChange" }
--           , argCType = Just "OstreeRepoRemoteChange"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Operation to perform"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "url"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GVariant of type a{sv}"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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
    -> Maybe (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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsCancellable c) =>
a
-> Maybe b
-> RepoRemoteChange
-> Text
-> Maybe Text
-> Maybe GVariant
-> Maybe c
-> m ()
repoRemoteChange a
self Maybe b
sysroot RepoRemoteChange
changeop Text
name Maybe Text
url Maybe GVariant
options Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeSysroot <- case sysroot of
        Maybe b
Nothing -> Ptr File -> IO (Ptr File)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
FP.nullPtr
        Just b
jSysroot -> do
            jSysroot' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jSysroot
            return jSysroot'
    let changeop' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (RepoRemoteChange -> Int) -> RepoRemoteChange -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoRemoteChange -> Int
forall a. Enum a => a -> Int
fromEnum) RepoRemoteChange
changeop
    name' <- textToCString name
    maybeUrl <- case url of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jUrl -> do
            jUrl' <- Text -> IO CString
textToCString Text
jUrl
            return jUrl'
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_change self' maybeSysroot changeop' name' maybeUrl maybeOptions maybeCancellable
        touchManagedPtr self
        whenJust sysroot touchManagedPtr
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem name'
        freeMem maybeUrl
        return ()
     ) (do
        freeMem name'
        freeMem maybeUrl
     )

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

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


#endif

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

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe b -> m ()
repoRemoteDelete a
self Text
name Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    name' <- textToCString name
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_delete self' name' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem name'
        return ()
     ) (do
        freeMem name'
     )

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

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


#endif

-- method Repo::remote_fetch_summary
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "name of a remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_summary"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes**"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_signatures"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes**"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.True'.
-- 
-- This method does not verify the signature of the downloaded summary file.
-- Use 'GI.OSTree.Objects.Repo.repoVerifySummary' for that.
-- 
-- Parse the summary data into a t'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 t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ((GLib.Bytes.Bytes, GLib.Bytes.Bytes))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoRemoteFetchSummary :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe b -> m (Bytes, Bytes)
repoRemoteFetchSummary a
self Text
name Maybe b
cancellable = IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bytes, Bytes) -> m (Bytes, Bytes))
-> IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    name' <- textToCString name
    outSummary <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    outSignatures <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::remote_fetch_summary_with_options
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "name of a remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_summary"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for raw summary data, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "out_signatures"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for raw summary signature\n                 data, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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
-- * http-headers (a(ss)): Additional headers to add to all HTTP requests
-- * append-user-agent (s): Additional string to append to the user agent
-- * n-network-retries (u): Number of times to retry each download on receiving
--   a transient network error, such as a socket timeout; default is 5, 0
--   means return errors without retrying
-- 
-- 
-- /Since: 2016.6/
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 t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ((GLib.Bytes.Bytes, GLib.Bytes.Bytes))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoRemoteFetchSummaryWithOptions :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe GVariant -> Maybe b -> m (Bytes, Bytes)
repoRemoteFetchSummaryWithOptions a
self Text
name Maybe GVariant
options Maybe b
cancellable = IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bytes, Bytes) -> m (Bytes, Bytes))
-> IO (Bytes, Bytes) -> m (Bytes, Bytes)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    name' <- textToCString name
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    outSummary <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    outSignatures <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoRemoteFetchSummaryWithOptionsMethodInfo a signature where
    overloadedMethod = repoRemoteFetchSummaryWithOptions

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


#endif

-- method Repo::remote_get_gpg_keys
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "name of the remote or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_ids"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "const char* const*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "\n   a %NULL-terminated array of GPG key IDs to include, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_keys"
--           , argType = TPtrArray TVariant
--           , argCType = Just "GPtrArray**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "\n   return location for a #GPtrArray of the remote's trusted GPG keys, or\n   %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferContainer
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_remote_get_gpg_keys" ostree_repo_remote_get_gpg_keys :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr CString ->                          -- key_ids : TCArray True (-1) (-1) (TBasicType TUTF8)
    Ptr (Ptr (GPtrArray (Ptr GVariant))) -> -- out_keys : TPtrArray TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Enumerate the trusted GPG keys for the remote /@name@/. If /@name@/ is
-- 'P.Nothing', the global GPG keys will be returned. The keys will be
-- returned in the /@outKeys@/ t'GI.GLib.Structs.PtrArray.PtrArray'. Each element in the array is a
-- t'GVariant' of format @/OSTREE_GPG_KEY_GVARIANT_FORMAT/@. The /@keyIds@/
-- array can be used to limit which keys are included. If /@keyIds@/ is
-- 'P.Nothing', then all keys are included.
-- 
-- /Since: 2021.4/
repoRemoteGetGpgKeys ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> Maybe (T.Text)
    -- ^ /@name@/: name of the remote or 'P.Nothing'
    -> Maybe ([T.Text])
    -- ^ /@keyIds@/: 
    --    a 'P.Nothing'-terminated array of GPG key IDs to include, or 'P.Nothing'
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> m ([GVariant])
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoRemoteGetGpgKeys :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe Text -> Maybe [Text] -> Maybe b -> m [GVariant]
repoRemoteGetGpgKeys a
self Maybe Text
name Maybe [Text]
keyIds Maybe b
cancellable = IO [GVariant] -> m [GVariant]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GVariant] -> m [GVariant]) -> IO [GVariant] -> m [GVariant]
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeName <- case name of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jName -> do
            jName' <- Text -> IO CString
textToCString Text
jName
            return jName'
    maybeKeyIds <- case keyIds of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
FP.nullPtr
        Just [Text]
jKeyIds -> do
            jKeyIds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jKeyIds
            return jKeyIds'
    outKeys <- callocMem :: IO (Ptr (Ptr (GPtrArray (Ptr GVariant))))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_get_gpg_keys self' maybeName maybeKeyIds outKeys maybeCancellable
        outKeys' <- peek outKeys
        outKeys'' <- unpackGPtrArray outKeys'
        outKeys''' <- mapM B.GVariant.newGVariantFromPtr outKeys''
        unrefPtrArray outKeys'
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem maybeName
        mapZeroTerminatedCArray freeMem maybeKeyIds
        freeMem maybeKeyIds
        freeMem outKeys
        return outKeys'''
     ) (do
        freeMem maybeName
        mapZeroTerminatedCArray freeMem maybeKeyIds
        freeMem maybeKeyIds
        freeMem outKeys
     )

#if defined(ENABLE_OVERLOADING)
data RepoRemoteGetGpgKeysMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe ([T.Text]) -> Maybe (b) -> m ([GVariant])), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoRemoteGetGpgKeysMethodInfo a signature where
    overloadedMethod = repoRemoteGetGpgKeys

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


#endif

-- method Repo::remote_get_gpg_verify
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_gpg_verify"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Remote's GPG option"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> m Bool
repoRemoteGetGpgVerify a
self Text
name = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
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'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outGpgVerify'
        touchManagedPtr self
        freeMem name'
        freeMem outGpgVerify
        return outGpgVerify''
     ) (do
        freeMem name'
        freeMem outGpgVerify
     )

#if defined(ENABLE_OVERLOADING)
data RepoRemoteGetGpgVerifyMethodInfo
instance (signature ~ (T.Text -> m (Bool)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoRemoteGetGpgVerifyMethodInfo a signature where
    overloadedMethod = repoRemoteGetGpgVerify

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


#endif

-- method Repo::remote_get_gpg_verify_summary
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_gpg_verify_summary"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Remote's GPG option"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> m Bool
repoRemoteGetGpgVerifySummary a
self Text
name = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
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'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outGpgVerifySummary'
        touchManagedPtr self
        freeMem name'
        freeMem outGpgVerifySummary
        return outGpgVerifySummary''
     ) (do
        freeMem name'
        freeMem outGpgVerifySummary
     )

#if defined(ENABLE_OVERLOADING)
data RepoRemoteGetGpgVerifySummaryMethodInfo
instance (signature ~ (T.Text -> m (Bool)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoRemoteGetGpgVerifySummaryMethodInfo a signature where
    overloadedMethod = repoRemoteGetGpgVerifySummary

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


#endif

-- method Repo::remote_get_url
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_url"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Remote's URL" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> m Text
repoRemoteGetUrl a
self Text
name = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    name' <- textToCString name
    outUrl <- callocMem :: 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
     )

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

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


#endif

-- method Repo::remote_gpg_import
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "name of a remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source_stream"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GInputStream, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_ids"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , argCType = Just "const char* const*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a %NULL-terminated array of\nGPG key IDs, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_imported"
--           , argType = TBasicType TUInt
--           , argCType = Just "guint*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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)
    Ptr 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 'P.Nothing'.  The /@keyIds@/ array
-- can optionally restrict which keys are imported.  If /@keyIds@/ is 'P.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 t'GI.Gio.Objects.InputStream.InputStream', or 'P.Nothing'
    -> Maybe ([T.Text])
    -- ^ /@keyIds@/: a 'P.Nothing'-terminated array of
    -- GPG key IDs, or 'P.Nothing'
    -> Maybe (c)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m (Word32)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoRemoteGpgImport :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsInputStream b,
 IsCancellable c) =>
a -> Text -> Maybe b -> Maybe [Text] -> Maybe c -> m Word32
repoRemoteGpgImport a
self Text
name Maybe b
sourceStream Maybe [Text]
keyIds Maybe c
cancellable = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    name' <- textToCString name
    maybeSourceStream <- case sourceStream of
        Maybe b
Nothing -> Ptr InputStream -> IO (Ptr InputStream)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr InputStream
forall a. Ptr a
FP.nullPtr
        Just b
jSourceStream -> do
            jSourceStream' <- b -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jSourceStream
            return jSourceStream'
    maybeKeyIds <- case keyIds of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
FP.nullPtr
        Just [Text]
jKeyIds -> do
            jKeyIds' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jKeyIds
            return jKeyIds'
    outImported <- allocMem :: IO (Ptr Word32)
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_remote_gpg_import self' name' maybeSourceStream maybeKeyIds outImported maybeCancellable
        outImported' <- peek outImported
        touchManagedPtr self
        whenJust sourceStream touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem name'
        mapZeroTerminatedCArray freeMem maybeKeyIds
        freeMem maybeKeyIds
        freeMem outImported
        return outImported'
     ) (do
        freeMem name'
        mapZeroTerminatedCArray freeMem maybeKeyIds
        freeMem maybeKeyIds
        freeMem outImported
     )

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

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


#endif

-- method Repo::remote_list
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_n_remotes"
--           , argType = TBasicType TUInt
--           , argCType = Just "guint*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of remotes available"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "out_n_remotes"
--              , argType = TBasicType TUInt
--              , argCType = Just "guint*"
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "Number of remotes available"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , argCallbackUserData = 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 t'GI.OSTree.Objects.Repo.Repo'.  Remote names are sorted
-- alphabetically.  If no remotes are available the function returns 'P.Nothing'.
repoRemoteList ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> m [T.Text]
    -- ^ __Returns:__ a 'P.Nothing'-terminated
    --          array of remote names
repoRemoteList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> m [Text]
repoRemoteList a
self = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
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'

#if defined(ENABLE_OVERLOADING)
data RepoRemoteListMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsRepo a) => O.OverloadedMethod RepoRemoteListMethodInfo a signature where
    overloadedMethod = repoRemoteList

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


#endif

-- XXX Could not generate method Repo::remote_list_collection_refs
-- Not implemented: GHashTable element of type TInterface (Name {namespace = "OSTree", name = "CollectionRef"}) unsupported.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoRemoteListCollectionRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "remoteListCollectionRefs" Repo) => O.OverloadedMethod RepoRemoteListCollectionRefsMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "remoteListCollectionRefs" Repo) => O.OverloadedMethodInfo RepoRemoteListCollectionRefsMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Repo::remote_list_refs
-- Not implemented: Hash table argument with transfer = Container? outAllRefs'
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoRemoteListRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "remoteListRefs" Repo) => O.OverloadedMethod RepoRemoteListRefsMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "remoteListRefs" Repo) => O.OverloadedMethodInfo RepoRemoteListRefsMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- method Repo::resolve_collection_ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ref"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "CollectionRef" }
--           , argCType = Just "const OstreeCollectionRef*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a collection\8211ref to resolve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "allow_noent"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "%TRUE to not throw an error if @ref doesn\8217t exist"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoResolveRevExtFlags" }
--           , argCType = Just "OstreeRepoResolveRevExtFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "options controlling behaviour"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_rev"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "return location for\n   the checksum corresponding to @ref, or %NULL if @allow_noent is %TRUE and\n   the @ref could not be found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_resolve_collection_ref" ostree_repo_resolve_collection_ref :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr OSTree.CollectionRef.CollectionRef -> -- ref : TInterface (Name {namespace = "OSTree", name = "CollectionRef"})
    CInt ->                                 -- allow_noent : TBasicType TBoolean
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoResolveRevExtFlags"})
    Ptr CString ->                          -- out_rev : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Look up the checksum for the given collection–ref, returning it in /@outRev@/.
-- This will search through the mirrors and remote refs.
-- 
-- If /@allowNoent@/ is 'P.True' and the given /@ref@/ cannot be found, 'P.True' will be
-- returned and /@outRev@/ will be set to 'P.Nothing'. If /@allowNoent@/ is 'P.False' and
-- the given /@ref@/ cannot be found, a 'GI.Gio.Enums.IOErrorEnumNotFound' error will be
-- returned.
-- 
-- If you want to check only local refs, not remote or mirrored ones, use the
-- flag 'GI.OSTree.Flags.RepoResolveRevExtFlagsLocalOnly'. This is analogous to using
-- 'GI.OSTree.Objects.Repo.repoResolveRevExt' but for collection-refs.
-- 
-- /Since: 2018.6/
repoResolveCollectionRef ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> OSTree.CollectionRef.CollectionRef
    -- ^ /@ref@/: a collection–ref to resolve
    -> Bool
    -- ^ /@allowNoent@/: 'P.True' to not throw an error if /@ref@/ doesn’t exist
    -> [OSTree.Flags.RepoResolveRevExtFlags]
    -- ^ /@flags@/: options controlling behaviour
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> m ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoResolveCollectionRef :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> CollectionRef
-> Bool
-> [RepoResolveRevExtFlags]
-> Maybe b
-> m (Maybe Text)
repoResolveCollectionRef a
self CollectionRef
ref Bool
allowNoent [RepoResolveRevExtFlags]
flags Maybe b
cancellable = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    ref' <- unsafeManagedPtrGetPtr ref
    let allowNoent' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
allowNoent
    let flags' = [RepoResolveRevExtFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoResolveRevExtFlags]
flags
    outRev <- callocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_resolve_collection_ref self' ref' allowNoent' flags' outRev maybeCancellable
        outRev' <- peek outRev
        maybeOutRev' <- convertIfNonNull outRev' $ \CString
outRev'' -> do
            outRev''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outRev''
            return outRev'''
        freeMem outRev'
        touchManagedPtr self
        touchManagedPtr ref
        whenJust cancellable touchManagedPtr
        freeMem outRev
        return maybeOutRev'
     ) (do
        freeMem outRev
     )

#if defined(ENABLE_OVERLOADING)
data RepoResolveCollectionRefMethodInfo
instance (signature ~ (OSTree.CollectionRef.CollectionRef -> Bool -> [OSTree.Flags.RepoResolveRevExtFlags] -> Maybe (b) -> m ((Maybe T.Text))), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoResolveCollectionRefMethodInfo a signature where
    overloadedMethod = repoResolveCollectionRef

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


#endif

-- method Repo::resolve_keyring_for_collection
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "collection_id"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the collection ID to look up a keyring for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "OSTree" , name = "Remote" })
-- throws : True
-- Skip return : False

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

-- | Find the GPG keyring for the given /@collectionId@/, using the local
-- configuration from the given t'GI.OSTree.Objects.Repo.Repo'. This will search the configured
-- remotes for ones whose @collection-id@ key matches /@collectionId@/, and will
-- return the first matching remote.
-- 
-- If multiple remotes match and have different keyrings, a debug message will
-- be emitted, and the first result will be returned. It is expected that the
-- keyrings should match.
-- 
-- If no match can be found, a 'GI.Gio.Enums.IOErrorEnumNotFound' error will be returned.
-- 
-- /Since: 2018.6/
repoResolveKeyringForCollection ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> T.Text
    -- ^ /@collectionId@/: the collection ID to look up a keyring for
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> m OSTree.Remote.Remote
    -- ^ __Returns:__ t'GI.OSTree.Structs.Remote.Remote' containing the GPG keyring for
    --    /@collectionId@/ /(Can throw 'Data.GI.Base.GError.GError')/
repoResolveKeyringForCollection :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe b -> m Remote
repoResolveKeyringForCollection a
self Text
collectionId Maybe b
cancellable = IO Remote -> m Remote
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Remote -> m Remote) -> IO Remote -> m Remote
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    collectionId' <- textToCString collectionId
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_resolve_keyring_for_collection self' collectionId' maybeCancellable
        checkUnexpectedReturnNULL "repoResolveKeyringForCollection" result
        result' <- (wrapBoxed OSTree.Remote.Remote) result
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem collectionId'
        return result'
     ) (do
        freeMem collectionId'
     )

#if defined(ENABLE_OVERLOADING)
data RepoResolveKeyringForCollectionMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m OSTree.Remote.Remote), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoResolveKeyringForCollectionMethodInfo a signature where
    overloadedMethod = repoResolveKeyringForCollection

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


#endif

-- method Repo::resolve_rev
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refspec"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A refspec" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "allow_noent"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_rev"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "A checksum,or %NULL if @allow_noent is true and it\ndoes not exist"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoResolveRev :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Bool -> m (Maybe Text)
repoResolveRev a
self Text
refspec Bool
allowNoent = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    refspec' <- textToCString refspec
    let allowNoent' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
allowNoent
    outRev <- callocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_resolve_rev self' refspec' allowNoent' outRev
        outRev' <- peek outRev
        maybeOutRev' <- convertIfNonNull outRev' $ \CString
outRev'' -> do
            outRev''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outRev''
            return outRev'''
        freeMem outRev'
        touchManagedPtr self
        freeMem refspec'
        freeMem outRev
        return maybeOutRev'
     ) (do
        freeMem refspec'
        freeMem outRev
     )

#if defined(ENABLE_OVERLOADING)
data RepoResolveRevMethodInfo
instance (signature ~ (T.Text -> Bool -> m ((Maybe T.Text))), MonadIO m, IsRepo a) => O.OverloadedMethod RepoResolveRevMethodInfo a signature where
    overloadedMethod = repoResolveRev

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


#endif

-- method Repo::resolve_rev_ext
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "refspec"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A refspec" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "allow_noent"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoResolveRevExtFlags" }
--           , argCType = Just "OstreeRepoResolveRevExtFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Options controlling behavior"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_rev"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "A checksum,or %NULL if @allow_noent is true and it\ndoes not exist"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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.
-- 
-- The flag 'GI.OSTree.Flags.RepoResolveRevExtFlagsLocalOnly' is implied so
-- using it has no effect.
-- 
-- /Since: 2016.7/
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.Flags.RepoResolveRevExtFlags]
    -- ^ /@flags@/: Options controlling behavior
    -> m ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoResolveRevExt :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Bool -> [RepoResolveRevExtFlags] -> m (Maybe Text)
repoResolveRevExt a
self Text
refspec Bool
allowNoent [RepoResolveRevExtFlags]
flags = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    refspec' <- textToCString refspec
    let allowNoent' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
allowNoent
    let flags' = [RepoResolveRevExtFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoResolveRevExtFlags]
flags
    outRev <- callocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_resolve_rev_ext self' refspec' allowNoent' flags' outRev
        outRev' <- peek outRev
        maybeOutRev' <- convertIfNonNull outRev' $ \CString
outRev'' -> do
            outRev''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outRev''
            return outRev'''
        freeMem outRev'
        touchManagedPtr self
        freeMem refspec'
        freeMem outRev
        return maybeOutRev'
     ) (do
        freeMem refspec'
        freeMem outRev
     )

#if defined(ENABLE_OVERLOADING)
data RepoResolveRevExtMethodInfo
instance (signature ~ (T.Text -> Bool -> [OSTree.Flags.RepoResolveRevExtFlags] -> m ((Maybe T.Text))), MonadIO m, IsRepo a) => O.OverloadedMethod RepoResolveRevExtMethodInfo a signature where
    overloadedMethod = repoResolveRevExt

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


#endif

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

foreign import ccall "ostree_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

-- | This function is deprecated in favor of using 'GI.OSTree.Structs.RepoDevInoCache.repoDevInoCacheNew',
-- which allows a precise mapping to be built up between hardlink checkout files
-- and their checksums between @ostree_repo_checkout_at()@ and
-- @ostree_repo_write_directory_to_mtree()@.
-- 
-- When invoking 'GI.OSTree.Objects.Repo.repoWriteDirectoryToMtree', it has to compute the
-- checksum of all files. If your commit contains hardlinks from a checkout,
-- this functions builds 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 'GI.OSTree.Objects.Repo.repoWriteDirectoryToMtree' or similar.  However,
-- 'GI.OSTree.Structs.RepoDevInoCache.repoDevInoCacheNew' is better as it avoids scanning all objects.
-- 
-- Multithreading: This function is *not* MT safe.
repoScanHardlinks ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoScanHardlinks :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe b -> m ()
repoScanHardlinks a
self Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_scan_hardlinks self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoScanHardlinksMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoScanHardlinksMethodInfo a signature where
    overloadedMethod = repoScanHardlinks

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


#endif

-- method Repo::set_alias_ref_immediate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A remote for the ref"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ref"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The ref to write" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "target"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The ref target to point it to, or %NULL to unset"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

-- | Like 'GI.OSTree.Objects.Repo.repoSetRefImmediate', but creates an alias.
-- 
-- /Since: 2017.10/
repoSetAliasRefImmediate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> Maybe (T.Text)
    -- ^ /@remote@/: A remote for the ref
    -> T.Text
    -- ^ /@ref@/: The ref to write
    -> Maybe (T.Text)
    -- ^ /@target@/: The ref target to point it to, or 'P.Nothing' to unset
    -> Maybe (b)
    -- ^ /@cancellable@/: GCancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSetAliasRefImmediate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe Text -> Text -> Maybe Text -> Maybe b -> m ()
repoSetAliasRefImmediate a
self Maybe Text
remote Text
ref Maybe Text
target Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeRemote <- case remote of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jRemote -> do
            jRemote' <- Text -> IO CString
textToCString Text
jRemote
            return jRemote'
    ref' <- textToCString ref
    maybeTarget <- case target of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jTarget -> do
            jTarget' <- Text -> IO CString
textToCString Text
jTarget
            return jTarget'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_set_alias_ref_immediate self' maybeRemote ref' maybeTarget maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem maybeRemote
        freeMem ref'
        freeMem maybeTarget
        return ()
     ) (do
        freeMem maybeRemote
        freeMem ref'
        freeMem maybeTarget
     )

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

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


#endif

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

foreign import ccall "ostree_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.
-- 
-- /Since: 2016.5/
repoSetCacheDir ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> Int32
    -- ^ /@dfd@/: directory fd
    -> T.Text
    -- ^ /@path@/: subpath in /@dfd@/
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSetCacheDir :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Int32 -> Text -> Maybe b -> m ()
repoSetCacheDir a
self Int32
dfd Text
path Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    path' <- textToCString path
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_set_cache_dir self' dfd path' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem path'
        return ()
     ) (do
        freeMem path'
     )

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

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


#endif

-- method Repo::set_collection_id
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "collection_id"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "new collection ID, or %NULL to unset it"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_set_collection_id" ostree_repo_set_collection_id :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- collection_id : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Set or clear the collection ID of this repository. See [collection IDs][collection-ids].
-- The update will be made in memory, but must be written out to the repository
-- configuration on disk using 'GI.OSTree.Objects.Repo.repoWriteConfig'.
-- 
-- /Since: 2018.6/
repoSetCollectionId ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Objects.Repo.Repo'
    -> Maybe (T.Text)
    -- ^ /@collectionId@/: new collection ID, or 'P.Nothing' to unset it
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSetCollectionId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Maybe Text -> m ()
repoSetCollectionId a
self Maybe Text
collectionId = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeCollectionId <- case collectionId of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jCollectionId -> do
            jCollectionId' <- Text -> IO CString
textToCString Text
jCollectionId
            return jCollectionId'
    onException (do
        _ <- propagateGError $ ostree_repo_set_collection_id self' maybeCollectionId
        touchManagedPtr self
        freeMem maybeCollectionId
        return ()
     ) (do
        freeMem maybeCollectionId
     )

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

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


#endif

-- method Repo::set_collection_ref_immediate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ref"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "CollectionRef" }
--           , argCType = Just "const OstreeCollectionRef*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The collection\8211ref to write"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_set_collection_ref_immediate" ostree_repo_set_collection_ref_immediate :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr OSTree.CollectionRef.CollectionRef -> -- ref : TInterface (Name {namespace = "OSTree", name = "CollectionRef"})
    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.repoTransactionSetCollectionRef', 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.
-- 
-- /Since: 2018.6/
repoSetCollectionRefImmediate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> OSTree.CollectionRef.CollectionRef
    -- ^ /@ref@/: The collection–ref to write
    -> Maybe (T.Text)
    -- ^ /@checksum@/: The checksum to point it to, or 'P.Nothing' to unset
    -> Maybe (b)
    -- ^ /@cancellable@/: GCancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSetCollectionRefImmediate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> CollectionRef -> Maybe Text -> Maybe b -> m ()
repoSetCollectionRefImmediate a
self CollectionRef
ref Maybe Text
checksum Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    ref' <- unsafeManagedPtrGetPtr ref
    maybeChecksum <- case checksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jChecksum -> do
            jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
            return jChecksum'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_set_collection_ref_immediate self' ref' maybeChecksum maybeCancellable
        touchManagedPtr self
        touchManagedPtr ref
        whenJust cancellable touchManagedPtr
        freeMem maybeChecksum
        return ()
     ) (do
        freeMem maybeChecksum
     )

#if defined(ENABLE_OVERLOADING)
data RepoSetCollectionRefImmediateMethodInfo
instance (signature ~ (OSTree.CollectionRef.CollectionRef -> Maybe (T.Text) -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoSetCollectionRefImmediateMethodInfo a signature where
    overloadedMethod = repoSetCollectionRefImmediate

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


#endif

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

foreign import ccall "ostree_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 t'GI.OSTree.Objects.Repo.Repo'
    -> Bool
    -- ^ /@disableFsync@/: If 'P.True', do not fsync
    -> m ()
repoSetDisableFsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Bool -> m ()
repoSetDisableFsync a
self Bool
disableFsync = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let disableFsync' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
disableFsync
    ostree_repo_set_disable_fsync self' disableFsync'
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data RepoSetDisableFsyncMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsRepo a) => O.OverloadedMethod RepoSetDisableFsyncMethodInfo a signature where
    overloadedMethod = repoSetDisableFsync

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


#endif

-- method Repo::set_ref_immediate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A remote for the ref"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ref"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The ref to write" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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.
-- 
-- Multithreading: This function is MT safe.
repoSetRefImmediate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: An t'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 'P.Nothing' to unset
    -> Maybe (b)
    -- ^ /@cancellable@/: GCancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSetRefImmediate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Maybe Text -> Text -> Maybe Text -> Maybe b -> m ()
repoSetRefImmediate a
self Maybe Text
remote Text
ref Maybe Text
checksum Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeRemote <- case remote of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jRemote -> do
            jRemote' <- Text -> IO CString
textToCString Text
jRemote
            return jRemote'
    ref' <- textToCString ref
    maybeChecksum <- case checksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jChecksum -> do
            jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
            return jChecksum'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::sign_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "SHA256 of given commit to sign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_id"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Use this GPG key id"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "homedir"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "GPG home directory, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.Nothing'
    -> Maybe (b)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSignCommit :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Text -> Maybe Text -> Maybe b -> m ()
repoSignCommit a
self Text
commitChecksum Text
keyId Maybe Text
homedir Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    commitChecksum' <- textToCString commitChecksum
    keyId' <- textToCString keyId
    maybeHomedir <- case homedir of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jHomedir -> do
            jHomedir' <- Text -> IO CString
textToCString Text
jHomedir
            return jHomedir'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::sign_delta
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "from_commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "From commit" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "To commit" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key_id"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "key id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "homedir"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "homedir" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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
    -- ^ /@self@/: Self
    -> T.Text
    -- ^ /@fromCommit@/: From commit
    -> T.Text
    -- ^ /@toCommit@/: To commit
    -> T.Text
    -- ^ /@keyId@/: key id
    -> T.Text
    -- ^ /@homedir@/: homedir
    -> Maybe (b)
    -- ^ /@cancellable@/: cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSignDelta :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Text -> Text -> Text -> Maybe b -> m ()
repoSignDelta a
self Text
fromCommit Text
toCommit Text
keyId Text
homedir Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    fromCommit' <- textToCString fromCommit
    toCommit' <- textToCString toCommit
    keyId' <- textToCString keyId
    homedir' <- textToCString homedir
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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'
     )

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

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


#endif

-- method Repo::signature_verify_commit_data
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_data"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Commit object data (GVariant)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_metadata"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Commit metadata (GVariant `a{sv}`), must contain at least one valid signature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoVerifyFlags" }
--           , argCType = Just "OstreeRepoVerifyFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Optionally disable GPG or signapi"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_results"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Textual description of results"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_signature_verify_commit_data" ostree_repo_signature_verify_commit_data :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- remote_name : TBasicType TUTF8
    Ptr GLib.Bytes.Bytes ->                 -- commit_data : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr GLib.Bytes.Bytes ->                 -- commit_metadata : TInterface (Name {namespace = "GLib", name = "Bytes"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "RepoVerifyFlags"})
    Ptr CString ->                          -- out_results : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Validate the commit data using the commit metadata which must
-- contain at least one valid signature.  If GPG and signapi are
-- both enabled, then both must find at least one valid signature.
repoSignatureVerifyCommitData ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> T.Text
    -- ^ /@remoteName@/: Name of remote
    -> GLib.Bytes.Bytes
    -- ^ /@commitData@/: Commit object data (GVariant)
    -> GLib.Bytes.Bytes
    -- ^ /@commitMetadata@/: Commit metadata (GVariant @a{sv}@), must contain at least one valid signature
    -> [OSTree.Flags.RepoVerifyFlags]
    -- ^ /@flags@/: Optionally disable GPG or signapi
    -> m (T.Text)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoSignatureVerifyCommitData :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Bytes -> Bytes -> [RepoVerifyFlags] -> m Text
repoSignatureVerifyCommitData a
self Text
remoteName Bytes
commitData Bytes
commitMetadata [RepoVerifyFlags]
flags = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteName' <- textToCString remoteName
    commitData' <- unsafeManagedPtrGetPtr commitData
    commitMetadata' <- unsafeManagedPtrGetPtr commitMetadata
    let flags' = [RepoVerifyFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RepoVerifyFlags]
flags
    outResults <- callocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_signature_verify_commit_data self' remoteName' commitData' commitMetadata' flags' outResults
        outResults' <- peek outResults
        outResults'' <- cstringToText outResults'
        freeMem outResults'
        touchManagedPtr self
        touchManagedPtr commitData
        touchManagedPtr commitMetadata
        freeMem remoteName'
        freeMem outResults
        return outResults''
     ) (do
        freeMem remoteName'
        freeMem outResults
     )

#if defined(ENABLE_OVERLOADING)
data RepoSignatureVerifyCommitDataMethodInfo
instance (signature ~ (T.Text -> GLib.Bytes.Bytes -> GLib.Bytes.Bytes -> [OSTree.Flags.RepoVerifyFlags] -> m (T.Text)), MonadIO m, IsRepo a) => O.OverloadedMethod RepoSignatureVerifyCommitDataMethodInfo a signature where
    overloadedMethod = repoSignatureVerifyCommitData

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


#endif

-- method Repo::static_delta_execute_offline
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dir_or_file"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "skip_validation"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "If %TRUE, assume data integrity"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.True', assume data integrity
    -> Maybe (c)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoStaticDeltaExecuteOffline :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsCancellable c) =>
a -> b -> Bool -> Maybe c -> m ()
repoStaticDeltaExecuteOffline a
self b
dirOrFile Bool
skipValidation Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    dirOrFile' <- unsafeManagedPtrCastPtr dirOrFile
    let skipValidation' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
skipValidation
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_static_delta_execute_offline self' dirOrFile' skipValidation' maybeCancellable
        touchManagedPtr self
        touchManagedPtr dirOrFile
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

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

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


#endif

-- method Repo::static_delta_execute_offline_with_signature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dir_or_file"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sign"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Signature engine used to check superblock"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "skip_validation"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "If %TRUE, assume data integrity"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_static_delta_execute_offline_with_signature" ostree_repo_static_delta_execute_offline_with_signature :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr Gio.File.File ->                    -- dir_or_file : TInterface (Name {namespace = "Gio", name = "File"})
    Ptr OSTree.Sign.Sign ->                 -- sign : TInterface (Name {namespace = "OSTree", name = "Sign"})
    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.
-- If sign is passed, the static delta signature is verified.
-- If sign-verify-deltas configuration option is set and static delta is signed,
-- signature verification will be mandatory before apply the static delta.
-- 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.
-- 
-- /Since: 2020.7/
repoStaticDeltaExecuteOfflineWithSignature ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.Sign.IsSign c, Gio.Cancellable.IsCancellable d) =>
    a
    -- ^ /@self@/: Repo
    -> b
    -- ^ /@dirOrFile@/: Path to a directory containing static delta data, or directly to the superblock
    -> c
    -- ^ /@sign@/: Signature engine used to check superblock
    -> Bool
    -- ^ /@skipValidation@/: If 'P.True', assume data integrity
    -> Maybe (d)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoStaticDeltaExecuteOfflineWithSignature :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsSign c,
 IsCancellable d) =>
a -> b -> c -> Bool -> Maybe d -> m ()
repoStaticDeltaExecuteOfflineWithSignature a
self b
dirOrFile c
sign Bool
skipValidation Maybe d
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    dirOrFile' <- unsafeManagedPtrCastPtr dirOrFile
    sign' <- unsafeManagedPtrCastPtr sign
    let skipValidation' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
skipValidation
    maybeCancellable <- case cancellable of
        Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just d
jCancellable -> do
            jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_static_delta_execute_offline_with_signature self' dirOrFile' sign' skipValidation' maybeCancellable
        touchManagedPtr self
        touchManagedPtr dirOrFile
        touchManagedPtr sign
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoStaticDeltaExecuteOfflineWithSignatureMethodInfo
instance (signature ~ (b -> c -> Bool -> Maybe (d) -> m ()), MonadIO m, IsRepo a, Gio.File.IsFile b, OSTree.Sign.IsSign c, Gio.Cancellable.IsCancellable d) => O.OverloadedMethod RepoStaticDeltaExecuteOfflineWithSignatureMethodInfo a signature where
    overloadedMethod = repoStaticDeltaExecuteOfflineWithSignature

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


#endif

-- method Repo::static_delta_generate
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "opt"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "StaticDeltaGenerateOpt" }
--           , argCType = Just "OstreeStaticDeltaGenerateOpt"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "High level optimization choice"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "from"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum of origin, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum of target"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metadata"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Optional metadata" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "params"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Parameters, see below"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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@/ ('P.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 (bytestring), and parts in the same
-- 
-- directory.  Default saves to repository.
-- * sign-name: ^ay: Signature type to use (bytestring).
-- * sign-key-ids: ^as: NULL-terminated array of keys used to sign delta superblock.
repoStaticDeltaGenerate ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: Repo
    -> OSTree.Enums.StaticDeltaGenerateOpt
    -- ^ /@opt@/: High level optimization choice
    -> Maybe (T.Text)
    -- ^ /@from@/: ASCII SHA256 checksum of origin, or 'P.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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> StaticDeltaGenerateOpt
-> Maybe Text
-> Text
-> Maybe GVariant
-> Maybe GVariant
-> Maybe b
-> m ()
repoStaticDeltaGenerate a
self StaticDeltaGenerateOpt
opt Maybe Text
from Text
to Maybe GVariant
metadata Maybe GVariant
params Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let opt' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (StaticDeltaGenerateOpt -> Int)
-> StaticDeltaGenerateOpt
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaticDeltaGenerateOpt -> Int
forall a. Enum a => a -> Int
fromEnum) StaticDeltaGenerateOpt
opt
    maybeFrom <- case from of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jFrom -> do
            jFrom' <- Text -> IO CString
textToCString Text
jFrom
            return jFrom'
    to' <- textToCString to
    maybeMetadata <- case metadata of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jMetadata -> do
            jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
            return jMetadata'
    maybeParams <- case params of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jParams -> do
            jParams' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jParams
            return jParams'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_static_delta_generate self' opt' maybeFrom to' maybeMetadata maybeParams maybeCancellable
        touchManagedPtr self
        whenJust metadata touchManagedPtr
        whenJust params touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem maybeFrom
        freeMem to'
        return ()
     ) (do
        freeMem maybeFrom
        freeMem to'
     )

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

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


#endif

-- method Repo::static_delta_reindex
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "StaticDeltaIndexFlags" }
--           , argCType = Just "OstreeStaticDeltaIndexFlags"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Flags affecting the indexing operation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "opt_to_commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "ASCII SHA256 checksum of target commit, or %NULL to index all targets"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_static_delta_reindex" ostree_repo_static_delta_reindex :: 
    Ptr Repo ->                             -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "OSTree", name = "StaticDeltaIndexFlags"})
    CString ->                              -- opt_to_commit : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | The delta index for a particular commit lists all the existing deltas that can be used
-- when downloading that commit. This operation regenerates these indexes, either for
-- a particular commit (if /@optToCommit@/ is non-'P.Nothing'), or for all commits that
-- are reachable by an existing delta (if /@optToCommit@/ is 'P.Nothing').
-- 
-- This is normally called automatically when the summary is updated in
-- 'GI.OSTree.Objects.Repo.repoRegenerateSummary'.
-- 
-- Locking: shared
-- 
-- /Since: 2020.8/
repoStaticDeltaReindex ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@repo@/: Repo
    -> OSTree.Enums.StaticDeltaIndexFlags
    -- ^ /@flags@/: Flags affecting the indexing operation
    -> T.Text
    -- ^ /@optToCommit@/: ASCII SHA256 checksum of target commit, or 'P.Nothing' to index all targets
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoStaticDeltaReindex :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> StaticDeltaIndexFlags -> Text -> Maybe b -> m ()
repoStaticDeltaReindex a
repo StaticDeltaIndexFlags
flags Text
optToCommit Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    repo' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
repo
    let flags' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (StaticDeltaIndexFlags -> Int) -> StaticDeltaIndexFlags -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaticDeltaIndexFlags -> Int
forall a. Enum a => a -> Int
fromEnum) StaticDeltaIndexFlags
flags
    optToCommit' <- textToCString optToCommit
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_static_delta_reindex repo' flags' optToCommit' maybeCancellable
        touchManagedPtr repo
        whenJust cancellable touchManagedPtr
        freeMem optToCommit'
        return ()
     ) (do
        freeMem optToCommit'
     )

#if defined(ENABLE_OVERLOADING)
data RepoStaticDeltaReindexMethodInfo
instance (signature ~ (OSTree.Enums.StaticDeltaIndexFlags -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoStaticDeltaReindexMethodInfo a signature where
    overloadedMethod = repoStaticDeltaReindex

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


#endif

-- method Repo::static_delta_verify_signature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "delta_id"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "delta path" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sign"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Signature engine used to check superblock"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_success_message"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "success message" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_static_delta_verify_signature" ostree_repo_static_delta_verify_signature :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- delta_id : TBasicType TUTF8
    Ptr OSTree.Sign.Sign ->                 -- sign : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr CString ->                          -- out_success_message : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Verify static delta file signature.
-- 
-- /Since: 2020.7/
repoStaticDeltaVerifySignature ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.Sign.IsSign b) =>
    a
    -- ^ /@self@/: Repo
    -> T.Text
    -- ^ /@deltaId@/: delta path
    -> b
    -- ^ /@sign@/: Signature engine used to check superblock
    -> m ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoStaticDeltaVerifySignature :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsSign b) =>
a -> Text -> b -> m (Maybe Text)
repoStaticDeltaVerifySignature a
self Text
deltaId b
sign = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    deltaId' <- textToCString deltaId
    sign' <- unsafeManagedPtrCastPtr sign
    outSuccessMessage <- callocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_repo_static_delta_verify_signature self' deltaId' sign' outSuccessMessage
        outSuccessMessage' <- peek outSuccessMessage
        maybeOutSuccessMessage' <- convertIfNonNull outSuccessMessage' $ \CString
outSuccessMessage'' -> do
            outSuccessMessage''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outSuccessMessage''
            return outSuccessMessage'''
        freeMem outSuccessMessage'
        touchManagedPtr self
        touchManagedPtr sign
        freeMem deltaId'
        freeMem outSuccessMessage
        return maybeOutSuccessMessage'
     ) (do
        freeMem deltaId'
        freeMem outSuccessMessage
     )

#if defined(ENABLE_OVERLOADING)
data RepoStaticDeltaVerifySignatureMethodInfo
instance (signature ~ (T.Text -> b -> m ((Maybe T.Text))), MonadIO m, IsRepo a, OSTree.Sign.IsSign b) => O.OverloadedMethod RepoStaticDeltaVerifySignatureMethodInfo a signature where
    overloadedMethod = repoStaticDeltaVerifySignature

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


#endif

-- method Repo::transaction_set_collection_ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ref"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "CollectionRef" }
--           , argCType = Just "const OstreeCollectionRef*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The collection\8211ref to write"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The checksum to point it to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

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

-- | If /@checksum@/ is not 'P.Nothing', then record it as the target of local ref named
-- /@ref@/.
-- 
-- Otherwise, if /@checksum@/ is 'P.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.
-- 
-- Multithreading: Since v2017.15 this function is MT safe.
-- 
-- /Since: 2018.6/
repoTransactionSetCollectionRef ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> OSTree.CollectionRef.CollectionRef
    -- ^ /@ref@/: The collection–ref to write
    -> Maybe (T.Text)
    -- ^ /@checksum@/: The checksum to point it to
    -> m ()
repoTransactionSetCollectionRef :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> CollectionRef -> Maybe Text -> m ()
repoTransactionSetCollectionRef a
self CollectionRef
ref Maybe Text
checksum = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    ref' <- unsafeManagedPtrGetPtr ref
    maybeChecksum <- case checksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jChecksum -> do
            jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
            return jChecksum'
    ostree_repo_transaction_set_collection_ref self' ref' maybeChecksum
    touchManagedPtr self
    touchManagedPtr ref
    freeMem maybeChecksum
    return ()

#if defined(ENABLE_OVERLOADING)
data RepoTransactionSetCollectionRefMethodInfo
instance (signature ~ (OSTree.CollectionRef.CollectionRef -> Maybe (T.Text) -> m ()), MonadIO m, IsRepo a) => O.OverloadedMethod RepoTransactionSetCollectionRefMethodInfo a signature where
    overloadedMethod = repoTransactionSetCollectionRef

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


#endif

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

foreign import ccall "ostree_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 'P.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 'P.Nothing', then record that the ref should
-- be deleted.
-- 
-- The change will be written when the transaction is completed with
-- 'GI.OSTree.Objects.Repo.repoCommitTransaction'; that function takes care of writing all of
-- the objects (such as the commit referred to by /@checksum@/) before updating the
-- refs. If the transaction is instead aborted with
-- 'GI.OSTree.Objects.Repo.repoAbortTransaction', no changes to the ref will be made to the
-- repository.
-- 
-- Note however that currently writing *multiple* refs is not truly atomic; if
-- the process or system is terminated during
-- 'GI.OSTree.Objects.Repo.repoCommitTransaction', it is possible that just some of the refs
-- will have been updated. Your application should take care to handle this
-- case.
-- 
-- Multithreading: Since v2017.15 this function is MT safe.
repoTransactionSetRef ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: An t'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
    -> m ()
repoTransactionSetRef :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Maybe Text -> Text -> Maybe Text -> m ()
repoTransactionSetRef a
self Maybe Text
remote Text
ref Maybe Text
checksum = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeRemote <- case remote of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jRemote -> do
            jRemote' <- Text -> IO CString
textToCString Text
jRemote
            return jRemote'
    ref' <- textToCString ref
    maybeChecksum <- case checksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jChecksum -> do
            jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
            return jChecksum'
    ostree_repo_transaction_set_ref self' maybeRemote ref' maybeChecksum
    touchManagedPtr self
    freeMem maybeRemote
    freeMem ref'
    freeMem maybeChecksum
    return ()

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

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


#endif

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

foreign import ccall "ostree_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.
-- 
-- Multithreading: Since v2017.15 this function is MT safe.
repoTransactionSetRefspec ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> T.Text
    -- ^ /@refspec@/: The refspec to write
    -> Maybe (T.Text)
    -- ^ /@checksum@/: The checksum to point it to
    -> m ()
repoTransactionSetRefspec :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> Text -> Maybe Text -> m ()
repoTransactionSetRefspec a
self Text
refspec Maybe Text
checksum = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    refspec' <- textToCString refspec
    maybeChecksum <- case checksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jChecksum -> do
            jChecksum' <- Text -> IO CString
textToCString Text
jChecksum
            return jChecksum'
    ostree_repo_transaction_set_refspec self' refspec' maybeChecksum
    touchManagedPtr self
    freeMem refspec'
    freeMem maybeChecksum
    return ()

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

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


#endif

-- XXX Could not generate method Repo::traverse_commit
-- Not implemented: GHashTable element of type TVariant unsupported.
#if defined(ENABLE_OVERLOADING)
-- 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.UnsupportedMethodError "traverseCommit" Repo) => O.OverloadedMethod RepoTraverseCommitMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "traverseCommit" Repo) => O.OverloadedMethodInfo RepoTraverseCommitMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Repo::traverse_reachable_refs
-- Not implemented: GHashTable key of type TVariant unsupported.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoTraverseReachableRefsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "traverseReachableRefs" Repo) => O.OverloadedMethod RepoTraverseReachableRefsMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "traverseReachableRefs" Repo) => O.OverloadedMethodInfo RepoTraverseReachableRefsMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- method Repo::verify_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Repository" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keyringdir"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "extra_keyring"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsFile c,
 IsCancellable d) =>
a -> Text -> Maybe b -> Maybe c -> Maybe d -> m ()
repoVerifyCommit a
self Text
commitChecksum Maybe b
keyringdir Maybe c
extraKeyring Maybe d
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    commitChecksum' <- textToCString commitChecksum
    maybeKeyringdir <- case keyringdir of
        Maybe b
Nothing -> Ptr File -> IO (Ptr File)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
FP.nullPtr
        Just b
jKeyringdir -> do
            jKeyringdir' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jKeyringdir
            return jKeyringdir'
    maybeExtraKeyring <- case extraKeyring of
        Maybe c
Nothing -> Ptr File -> IO (Ptr File)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
FP.nullPtr
        Just c
jExtraKeyring -> do
            jExtraKeyring' <- c -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jExtraKeyring
            return jExtraKeyring'
    maybeCancellable <- case cancellable of
        Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just d
jCancellable -> do
            jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
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'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoVerifyCommitMethodInfo a signature where
    overloadedMethod = repoVerifyCommit

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


#endif

-- method Repo::verify_commit_ext
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Repository" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keyringdir"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "extra_keyring"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (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 t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
repoVerifyCommitExt :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsFile c,
 IsCancellable d) =>
a -> Text -> Maybe b -> Maybe c -> Maybe d -> m GpgVerifyResult
repoVerifyCommitExt a
self Text
commitChecksum Maybe b
keyringdir Maybe c
extraKeyring Maybe d
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    commitChecksum' <- textToCString commitChecksum
    maybeKeyringdir <- case keyringdir of
        Maybe b
Nothing -> Ptr File -> IO (Ptr File)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
FP.nullPtr
        Just b
jKeyringdir -> do
            jKeyringdir' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jKeyringdir
            return jKeyringdir'
    maybeExtraKeyring <- case extraKeyring of
        Maybe c
Nothing -> Ptr File -> IO (Ptr File)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
FP.nullPtr
        Just c
jExtraKeyring -> do
            jExtraKeyring' <- c -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jExtraKeyring
            return jExtraKeyring'
    maybeCancellable <- case cancellable of
        Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just d
jCancellable -> do
            jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
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'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoVerifyCommitExtMethodInfo a signature where
    overloadedMethod = repoVerifyCommitExt

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


#endif

-- method Repo::verify_commit_for_remote
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Repository" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OSTree remote to use for configuration"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (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@/.
-- 
-- /Since: 2016.14/
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 t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
repoVerifyCommitForRemote :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Text -> Maybe b -> m GpgVerifyResult
repoVerifyCommitForRemote a
self Text
commitChecksum Text
remoteName Maybe b
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    commitChecksum' <- textToCString commitChecksum
    remoteName' <- textToCString remoteName
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        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'
     )

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

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


#endif

-- method Repo::verify_summary
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "remote_name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name of remote" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "summary"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Summary data as a #GBytes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signatures"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Summary signatures as a #GBytes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (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 t'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 t'GI.GLib.Structs.Bytes.Bytes'
    -> GLib.Bytes.Bytes
    -- ^ /@signatures@/: Summary signatures as a t'GI.GLib.Structs.Bytes.Bytes'
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m OSTree.GpgVerifyResult.GpgVerifyResult
    -- ^ __Returns:__ an t'GI.OSTree.Objects.GpgVerifyResult.GpgVerifyResult', or 'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
repoVerifySummary :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Bytes -> Bytes -> Maybe b -> m GpgVerifyResult
repoVerifySummary a
self Text
remoteName Bytes
summary Bytes
signatures Maybe b
cancellable = IO GpgVerifyResult -> m GpgVerifyResult
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GpgVerifyResult -> m GpgVerifyResult)
-> IO GpgVerifyResult -> m GpgVerifyResult
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    remoteName' <- textToCString remoteName
    summary' <- unsafeManagedPtrGetPtr summary
    signatures' <- unsafeManagedPtrGetPtr signatures
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        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'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoVerifySummaryMethodInfo a signature where
    overloadedMethod = repoVerifySummary

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


#endif

-- method Repo::write_archive_to_mtree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "archive"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A path to an archive file"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mtree"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "MutableTree" }
--           , argCType = Just "OstreeMutableTree*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #OstreeMutableTree to write to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "modifier"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoCommitModifier" }
--           , argCType = Just "OstreeRepoCommitModifier*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Optional commit modifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "autocreate_parents"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Autocreate parent directories"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 t'GI.OSTree.Objects.Repo.Repo'
    -> b
    -- ^ /@archive@/: A path to an archive file
    -> c
    -- ^ /@mtree@/: The t'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 :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsMutableTree c,
 IsCancellable d) =>
a -> b -> c -> Maybe RepoCommitModifier -> Bool -> Maybe d -> m ()
repoWriteArchiveToMtree a
self b
archive c
mtree Maybe RepoCommitModifier
modifier Bool
autocreateParents Maybe d
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    archive' <- unsafeManagedPtrCastPtr archive
    mtree' <- unsafeManagedPtrCastPtr mtree
    maybeModifier <- case modifier of
        Maybe RepoCommitModifier
Nothing -> Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
forall a. Ptr a
FP.nullPtr
        Just RepoCommitModifier
jModifier -> do
            jModifier' <- RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCommitModifier
jModifier
            return jModifier'
    let autocreateParents' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
autocreateParents
    maybeCancellable <- case cancellable of
        Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just d
jCancellable -> do
            jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
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 ()
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteArchiveToMtreeMethodInfo a signature where
    overloadedMethod = repoWriteArchiveToMtree

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


#endif

-- method Repo::write_archive_to_mtree_from_fd
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "fd"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A file descriptor to read the archive from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mtree"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "MutableTree" }
--           , argCType = Just "OstreeMutableTree*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #OstreeMutableTree to write to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "modifier"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoCommitModifier" }
--           , argCType = Just "OstreeRepoCommitModifier*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Optional commit modifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "autocreate_parents"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Autocreate parent directories"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_write_archive_to_mtree_from_fd" ostree_repo_write_archive_to_mtree_from_fd :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Int32 ->                                -- fd : TBasicType TInt
    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

-- | Read an archive from /@fd@/ and import it into the repository, writing
-- its file structure to /@mtree@/.
repoWriteArchiveToMtreeFromFd ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: An t'GI.OSTree.Objects.Repo.Repo'
    -> Int32
    -- ^ /@fd@/: A file descriptor to read the archive from
    -> b
    -- ^ /@mtree@/: The t'GI.OSTree.Objects.MutableTree.MutableTree' to write to
    -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier)
    -- ^ /@modifier@/: Optional commit modifier
    -> Bool
    -- ^ /@autocreateParents@/: Autocreate parent directories
    -> Maybe (c)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteArchiveToMtreeFromFd :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsMutableTree b,
 IsCancellable c) =>
a
-> Int32
-> b
-> Maybe RepoCommitModifier
-> Bool
-> Maybe c
-> m ()
repoWriteArchiveToMtreeFromFd a
self Int32
fd b
mtree Maybe RepoCommitModifier
modifier Bool
autocreateParents Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    mtree' <- unsafeManagedPtrCastPtr mtree
    maybeModifier <- case modifier of
        Maybe RepoCommitModifier
Nothing -> Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
forall a. Ptr a
FP.nullPtr
        Just RepoCommitModifier
jModifier -> do
            jModifier' <- RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCommitModifier
jModifier
            return jModifier'
    let autocreateParents' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
autocreateParents
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_archive_to_mtree_from_fd self' fd mtree' maybeModifier autocreateParents' maybeCancellable
        touchManagedPtr self
        touchManagedPtr mtree
        whenJust modifier touchManagedPtr
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteArchiveToMtreeFromFdMethodInfo
instance (signature ~ (Int32 -> b -> Maybe (OSTree.RepoCommitModifier.RepoCommitModifier) -> Bool -> Maybe (c) -> m ()), MonadIO m, IsRepo a, OSTree.MutableTree.IsMutableTree b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod RepoWriteArchiveToMtreeFromFdMethodInfo a signature where
    overloadedMethod = repoWriteArchiveToMtreeFromFd

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


#endif

-- method Repo::write_commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "subject"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Subject" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "body"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Just "Body" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metadata"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "root"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFile" }
--           , argCType = Just "OstreeRepoFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Resulting ASCII SHA256 checksum for\ncommit"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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@/.
-- This uses the current time as the commit timestamp, but it can be
-- overridden with an explicit timestamp via the
-- <https://reproducible-builds.org/specs/source-date-epoch/ standard>
-- @SOURCE_DATE_EPOCH@ environment flag.
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 'P.Nothing' for none
    -> Maybe (T.Text)
    -- ^ /@subject@/: Subject
    -> Maybe (T.Text)
    -- ^ /@body@/: Body
    -> Maybe (GVariant)
    -- ^ /@metadata@/: GVariant of type a{sv}, or 'P.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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsRepoFile b,
 IsCancellable c) =>
a
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GVariant
-> b
-> Maybe c
-> m Text
repoWriteCommit a
self Maybe Text
parent Maybe Text
subject Maybe Text
body Maybe GVariant
metadata b
root Maybe c
cancellable = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeParent <- case parent of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jParent -> do
            jParent' <- Text -> IO CString
textToCString Text
jParent
            return jParent'
    maybeSubject <- case subject of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jSubject -> do
            jSubject' <- Text -> IO CString
textToCString Text
jSubject
            return jSubject'
    maybeBody <- case body of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jBody -> do
            jBody' <- Text -> IO CString
textToCString Text
jBody
            return jBody'
    maybeMetadata <- case metadata of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jMetadata -> do
            jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
            return jMetadata'
    root' <- unsafeManagedPtrCastPtr root
    outCommit <- callocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteCommitMethodInfo a signature where
    overloadedMethod = repoWriteCommit

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


#endif

-- method Repo::write_commit_detached_metadata
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ASCII SHA256 commit checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metadata"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Metadata to associate with commit in with format \"a{sv}\", or %NULL to\ndelete"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.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 'P.Nothing' to
    -- delete
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteCommitDetachedMetadata :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> Text -> Maybe GVariant -> Maybe b -> m ()
repoWriteCommitDetachedMetadata a
self Text
checksum Maybe GVariant
metadata Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    checksum' <- textToCString checksum
    maybeMetadata <- case metadata of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jMetadata -> do
            jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
            return jMetadata'
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_commit_detached_metadata self' checksum' maybeMetadata maybeCancellable
        touchManagedPtr self
        whenJust metadata touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

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

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


#endif

-- method Repo::write_commit_with_time
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parent"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "subject"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Subject" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "body"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Just "Body" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metadata"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "root"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoFile" }
--           , argCType = Just "OstreeRepoFile*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "time"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_commit"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Resulting ASCII SHA256 checksum for\ncommit"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 'P.Nothing' for none
    -> Maybe (T.Text)
    -- ^ /@subject@/: Subject
    -> Maybe (T.Text)
    -- ^ /@body@/: Body
    -> Maybe (GVariant)
    -- ^ /@metadata@/: GVariant of type a{sv}, or 'P.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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsRepoFile b,
 IsCancellable c) =>
a
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GVariant
-> b
-> Word64
-> Maybe c
-> m Text
repoWriteCommitWithTime a
self Maybe Text
parent Maybe Text
subject Maybe Text
body Maybe GVariant
metadata b
root Word64
time Maybe c
cancellable = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeParent <- case parent of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jParent -> do
            jParent' <- Text -> IO CString
textToCString Text
jParent
            return jParent'
    maybeSubject <- case subject of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jSubject -> do
            jSubject' <- Text -> IO CString
textToCString Text
jSubject
            return jSubject'
    maybeBody <- case body of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jBody -> do
            jBody' <- Text -> IO CString
textToCString Text
jBody
            return jBody'
    maybeMetadata <- case metadata of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jMetadata -> do
            jMetadata' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jMetadata
            return jMetadata'
    root' <- unsafeManagedPtrCastPtr root
    outCommit <- callocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteCommitWithTimeMethodInfo a signature where
    overloadedMethod = repoWriteCommitWithTime

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


#endif

-- method Repo::write_config
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "new_config"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "KeyFile" }
--           , argCType = Just "GKeyFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Overwrite the config file with this data"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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: This will not validate many elements of the configuration.
-- Prefer @ostree_repo_write_config_and_reload@.
repoWriteConfig ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> GLib.KeyFile.KeyFile
    -- ^ /@newConfig@/: Overwrite the config file with this data
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteConfig :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> KeyFile -> m ()
repoWriteConfig a
self KeyFile
newConfig = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    newConfig' <- unsafeManagedPtrGetPtr newConfig
    onException (do
        _ <- propagateGError $ ostree_repo_write_config self' newConfig'
        touchManagedPtr self
        touchManagedPtr newConfig
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteConfigMethodInfo
instance (signature ~ (GLib.KeyFile.KeyFile -> m ()), MonadIO m, IsRepo a) => O.OverloadedMethod RepoWriteConfigMethodInfo a signature where
    overloadedMethod = repoWriteConfig

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


#endif

-- method Repo::write_config_and_reload
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "new_config"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "KeyFile" }
--           , argCType = Just "GKeyFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Overwrite the config file with this data, and reload"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_write_config_and_reload" ostree_repo_write_config_and_reload :: 
    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 and reload.
-- The config will be validated.
repoWriteConfigAndReload ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo
    -> GLib.KeyFile.KeyFile
    -- ^ /@newConfig@/: Overwrite the config file with this data, and reload
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteConfigAndReload :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a -> KeyFile -> m ()
repoWriteConfigAndReload a
self KeyFile
newConfig = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    newConfig' <- unsafeManagedPtrGetPtr newConfig
    onException (do
        _ <- propagateGError $ ostree_repo_write_config_and_reload self' newConfig'
        touchManagedPtr self
        touchManagedPtr newConfig
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteConfigAndReloadMethodInfo
instance (signature ~ (GLib.KeyFile.KeyFile -> m ()), MonadIO m, IsRepo a) => O.OverloadedMethod RepoWriteConfigAndReloadMethodInfo a signature where
    overloadedMethod = repoWriteConfigAndReload

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


#endif

-- method Repo::write_content
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "expected_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object_input"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Content object stream"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Length of @object_input"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_csum"
--           , argType = TCArray False 32 (-1) (TBasicType TUInt8)
--           , argCType = Just "guchar**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Binary checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 ((Maybe ByteString))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteContent :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsInputStream b,
 IsCancellable c) =>
a -> Maybe Text -> b -> Word64 -> Maybe c -> m (Maybe ByteString)
repoWriteContent a
self Maybe Text
expectedChecksum b
objectInput Word64
length_ Maybe c
cancellable = IO (Maybe ByteString) -> m (Maybe ByteString)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ByteString) -> m (Maybe ByteString))
-> IO (Maybe ByteString) -> m (Maybe ByteString)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeExpectedChecksum <- case expectedChecksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jExpectedChecksum -> do
            jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
            return jExpectedChecksum'
    objectInput' <- unsafeManagedPtrCastPtr objectInput
    outCsum <- callocMem :: IO (Ptr (Ptr Word8))
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_content self' maybeExpectedChecksum objectInput' length_ outCsum maybeCancellable
        outCsum' <- peek outCsum
        maybeOutCsum' <- convertIfNonNull outCsum' $ \Ptr Word8
outCsum'' -> do
            outCsum''' <- (Integer -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Integer
32) Ptr Word8
outCsum''
            freeMem outCsum''
            return outCsum'''
        touchManagedPtr self
        touchManagedPtr objectInput
        whenJust cancellable touchManagedPtr
        freeMem maybeExpectedChecksum
        freeMem outCsum
        return maybeOutCsum'
     ) (do
        freeMem maybeExpectedChecksum
        freeMem outCsum
     )

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

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


#endif

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

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsInputStream b,
 IsCancellable c) =>
a
-> Maybe Text
-> b
-> Word64
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
repoWriteContentAsync a
self Maybe Text
expectedChecksum b
object Word64
length_ Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeExpectedChecksum <- case expectedChecksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jExpectedChecksum -> do
            jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
            return jExpectedChecksum'
    object' <- unsafeManagedPtrCastPtr object
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    maybeCallback <- case callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = Ptr a
forall a. Ptr a
nullPtr
    ostree_repo_write_content_async self' maybeExpectedChecksum object' length_ maybeCancellable maybeCallback userData
    touchManagedPtr self
    touchManagedPtr object
    whenJust cancellable touchManagedPtr
    freeMem maybeExpectedChecksum
    return ()

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteContentAsyncMethodInfo a signature where
    overloadedMethod = repoWriteContentAsync

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


#endif

-- method Repo::write_content_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #OstreeRepo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , argCType = Just "GAsyncResult*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GAsyncResult" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_csum"
--           , argType = TBasicType TUInt8
--           , argCType = Just "guchar**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "A binary SHA256\nchecksum of the content object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = 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 t'GI.OSTree.Objects.Repo.Repo'
    -> b
    -- ^ /@result@/: a t'GI.Gio.Interfaces.AsyncResult.AsyncResult'
    -> m (Word8)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteContentFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) =>
a -> b -> m Word8
repoWriteContentFinish a
self b
result_ = IO Word8 -> m Word8
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
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
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteContentFinishMethodInfo
instance (signature ~ (b -> m (Word8)), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod RepoWriteContentFinishMethodInfo a signature where
    overloadedMethod = repoWriteContentFinish

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


#endif

-- method Repo::write_content_trusted
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object_input"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Content stream" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Length of @object_input"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsInputStream b,
 IsCancellable c) =>
a -> Text -> b -> Word64 -> Maybe c -> m ()
repoWriteContentTrusted a
self Text
checksum b
objectInput Word64
length_ Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    checksum' <- textToCString checksum
    objectInput' <- unsafeManagedPtrCastPtr objectInput
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_content_trusted self' checksum' objectInput' length_ maybeCancellable
        touchManagedPtr self
        touchManagedPtr objectInput
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

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

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


#endif

-- method Repo::write_dfd_to_mtree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dfd"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Directory file descriptor"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Path" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mtree"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "MutableTree" }
--           , argCType = Just "OstreeMutableTree*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Overlay directory contents into this tree"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "modifier"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoCommitModifier" }
--           , argCType = Just "OstreeRepoCommitModifier*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Optional modifier" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsMutableTree b,
 IsCancellable c) =>
a
-> Int32
-> Text
-> b
-> Maybe RepoCommitModifier
-> Maybe c
-> m ()
repoWriteDfdToMtree a
self Int32
dfd Text
path b
mtree Maybe RepoCommitModifier
modifier Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    path' <- textToCString path
    mtree' <- unsafeManagedPtrCastPtr mtree
    maybeModifier <- case modifier of
        Maybe RepoCommitModifier
Nothing -> Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
forall a. Ptr a
FP.nullPtr
        Just RepoCommitModifier
jModifier -> do
            jModifier' <- RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCommitModifier
jModifier
            return jModifier'
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteDfdToMtreeMethodInfo a signature where
    overloadedMethod = repoWriteDfdToMtree

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


#endif

-- method Repo::write_directory_to_mtree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dir"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Path to a directory"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mtree"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "MutableTree" }
--           , argCType = Just "OstreeMutableTree*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Overlay directory contents into this tree"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "modifier"
--           , argType =
--               TInterface
--                 Name { namespace = "OSTree" , name = "RepoCommitModifier" }
--           , argCType = Just "OstreeRepoCommitModifier*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Optional modifier" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c d.
(HasCallStack, MonadIO m, IsRepo a, IsFile b, IsMutableTree c,
 IsCancellable d) =>
a -> b -> c -> Maybe RepoCommitModifier -> Maybe d -> m ()
repoWriteDirectoryToMtree a
self b
dir c
mtree Maybe RepoCommitModifier
modifier Maybe d
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    dir' <- unsafeManagedPtrCastPtr dir
    mtree' <- unsafeManagedPtrCastPtr mtree
    maybeModifier <- case modifier of
        Maybe RepoCommitModifier
Nothing -> Ptr RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr RepoCommitModifier
forall a. Ptr a
FP.nullPtr
        Just RepoCommitModifier
jModifier -> do
            jModifier' <- RepoCommitModifier -> IO (Ptr RepoCommitModifier)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RepoCommitModifier
jModifier
            return jModifier'
    maybeCancellable <- case cancellable of
        Maybe d
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just d
jCancellable -> do
            jCancellable' <- d -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr d
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 ()
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteDirectoryToMtreeMethodInfo a signature where
    overloadedMethod = repoWriteDirectoryToMtree

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


#endif

-- method Repo::write_metadata
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "expected_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Metadata" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_csum"
--           , argType = TCArray False 32 (-1) (TBasicType TUInt8)
--           , argCType = Just "guchar**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Binary checksum" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 /@object@/.  Return the checksum
-- as /@outCsum@/.
-- 
-- If /@expectedChecksum@/ is not 'P.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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> ObjectType -> Maybe Text -> GVariant -> Maybe b -> m ByteString
repoWriteMetadata a
self ObjectType
objtype Maybe Text
expectedChecksum GVariant
object Maybe b
cancellable = IO ByteString -> m ByteString
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    maybeExpectedChecksum <- case expectedChecksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jExpectedChecksum -> do
            jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
            return jExpectedChecksum'
    object' <- unsafeManagedPtrGetPtr object
    outCsum <- callocMem :: IO (Ptr (Ptr Word8))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::write_metadata_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "expected_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Metadata" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , argCType = Just "GAsyncReadyCallback"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Invoked when metadata is writed"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 6
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Data for @callback" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> ObjectType
-> Maybe Text
-> GVariant
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
repoWriteMetadataAsync a
self ObjectType
objtype Maybe Text
expectedChecksum GVariant
object Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    maybeExpectedChecksum <- case expectedChecksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jExpectedChecksum -> do
            jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
            return jExpectedChecksum'
    object' <- unsafeManagedPtrGetPtr object
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    maybeCallback <- case callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = Ptr a
forall a. Ptr a
nullPtr
    ostree_repo_write_metadata_async self' objtype' maybeExpectedChecksum object' maybeCancellable maybeCallback userData
    touchManagedPtr self
    touchManagedPtr object
    whenJust cancellable touchManagedPtr
    freeMem maybeExpectedChecksum
    return ()

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteMetadataAsyncMethodInfo a signature where
    overloadedMethod = repoWriteMetadataAsync

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


#endif

-- method Repo::write_metadata_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , argCType = Just "GAsyncResult*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Result" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_csum"
--           , argType = TCArray False 32 (-1) (TBasicType TUInt8)
--           , argCType = Just "guchar**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Binary checksum value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- 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"})
    Ptr (Ptr Word8) ->                      -- out_csum : TCArray False 32 (-1) (TBasicType TUInt8)
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Complete a call to 'GI.OSTree.Objects.Repo.repoWriteMetadataAsync'.
repoWriteMetadataFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: Repo
    -> b
    -- ^ /@result@/: Result
    -> m (ByteString)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteMetadataFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) =>
a -> b -> m ByteString
repoWriteMetadataFinish a
self b
result_ = IO ByteString -> m ByteString
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result_' <- unsafeManagedPtrCastPtr result_
    outCsum <- callocMem :: IO (Ptr (Ptr Word8))
    onException (do
        _ <- propagateGError $ ostree_repo_write_metadata_finish self' result_' outCsum
        outCsum' <- peek outCsum
        outCsum'' <- (unpackByteStringWithLength 32) outCsum'
        freeMem outCsum'
        touchManagedPtr self
        touchManagedPtr result_
        freeMem outCsum
        return outCsum''
     ) (do
        freeMem outCsum
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteMetadataFinishMethodInfo
instance (signature ~ (b -> m (ByteString)), MonadIO m, IsRepo a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod RepoWriteMetadataFinishMethodInfo a signature where
    overloadedMethod = repoWriteMetadataFinish

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


#endif

-- method Repo::write_metadata_stream_trusted
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object_input"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Metadata object stream"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Length, may be 0 for unknown"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsInputStream b,
 IsCancellable c) =>
a -> ObjectType -> Text -> b -> Word64 -> Maybe c -> m ()
repoWriteMetadataStreamTrusted a
self ObjectType
objtype Text
checksum b
objectInput Word64
length_ Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    checksum' <- textToCString checksum
    objectInput' <- unsafeManagedPtrCastPtr objectInput
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_metadata_stream_trusted self' objtype' checksum' objectInput' length_ maybeCancellable
        touchManagedPtr self
        touchManagedPtr objectInput
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

#if defined(ENABLE_OVERLOADING)
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.OverloadedMethod RepoWriteMetadataStreamTrustedMethodInfo a signature where
    overloadedMethod = repoWriteMetadataStreamTrusted

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


#endif

-- method Repo::write_metadata_trusted
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "objtype"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "ObjectType" }
--           , argCType = Just "OstreeObjectType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Object type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variant"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Metadata object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a -> ObjectType -> Text -> GVariant -> Maybe b -> m ()
repoWriteMetadataTrusted a
self ObjectType
objtype Text
checksum GVariant
variant Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let objtype' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ObjectType -> Int) -> ObjectType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ObjectType -> Int
forall a. Enum a => a -> Int
fromEnum) ObjectType
objtype
    checksum' <- textToCString checksum
    variant' <- unsafeManagedPtrGetPtr variant
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_repo_write_metadata_trusted self' objtype' checksum' variant' maybeCancellable
        touchManagedPtr self
        touchManagedPtr variant
        whenJust cancellable touchManagedPtr
        freeMem checksum'
        return ()
     ) (do
        freeMem checksum'
     )

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

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


#endif

-- method Repo::write_mtree
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mtree"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "MutableTree" }
--           , argCType = Just "OstreeMutableTree*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Mutable tree" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_file"
--           , argType = TInterface Name { namespace = "Gio" , name = "File" }
--           , argCType = Just "GFile**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "An #OstreeRepoFile representing @mtree's root."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsRepo a, IsMutableTree b,
 IsCancellable c) =>
a -> b -> Maybe c -> m File
repoWriteMtree a
self b
mtree Maybe c
cancellable = IO File -> m File
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    mtree' <- unsafeManagedPtrCastPtr mtree
    outFile <- callocMem :: IO (Ptr (Ptr Gio.File.File))
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_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
     )

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

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


#endif

-- method Repo::write_regfile
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Repo," , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "expected_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Expected checksum (SHA-256 hex string)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uid"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "gid"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "group id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mode"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Unix file mode" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "content_len"
--           , argType = TBasicType TUInt64
--           , argCType = Just "guint64"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Expected content length"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "xattrs"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Extended attributes (GVariant type `(ayay)`)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "OSTree" , name = "ContentWriter" })
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_write_regfile" ostree_repo_write_regfile :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- expected_checksum : TBasicType TUTF8
    Word32 ->                               -- uid : TBasicType TUInt32
    Word32 ->                               -- gid : TBasicType TUInt32
    Word32 ->                               -- mode : TBasicType TUInt32
    Word64 ->                               -- content_len : TBasicType TUInt64
    Ptr GVariant ->                         -- xattrs : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr OSTree.ContentWriter.ContentWriter)

-- | Create an @OstreeContentWriter@ that allows streaming output into
-- the repository.
-- 
-- /Since: 2021.2/
repoWriteRegfile ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a) =>
    a
    -- ^ /@self@/: Repo,
    -> Maybe (T.Text)
    -- ^ /@expectedChecksum@/: Expected checksum (SHA-256 hex string)
    -> Word32
    -- ^ /@uid@/: user id
    -> Word32
    -- ^ /@gid@/: group id
    -> Word32
    -- ^ /@mode@/: Unix file mode
    -> Word64
    -- ^ /@contentLen@/: Expected content length
    -> Maybe (GVariant)
    -- ^ /@xattrs@/: Extended attributes (GVariant type @(ayay)@)
    -> m OSTree.ContentWriter.ContentWriter
    -- ^ __Returns:__ A new writer, or 'P.Nothing' on error /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteRegfile :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepo a) =>
a
-> Maybe Text
-> Word32
-> Word32
-> Word32
-> Word64
-> Maybe GVariant
-> m ContentWriter
repoWriteRegfile a
self Maybe Text
expectedChecksum Word32
uid Word32
gid Word32
mode Word64
contentLen Maybe GVariant
xattrs = IO ContentWriter -> m ContentWriter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentWriter -> m ContentWriter)
-> IO ContentWriter -> m ContentWriter
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeExpectedChecksum <- case expectedChecksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jExpectedChecksum -> do
            jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
            return jExpectedChecksum'
    maybeXattrs <- case xattrs of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jXattrs -> do
            jXattrs' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jXattrs
            return jXattrs'
    onException (do
        result <- propagateGError $ ostree_repo_write_regfile self' maybeExpectedChecksum uid gid mode contentLen maybeXattrs
        checkUnexpectedReturnNULL "repoWriteRegfile" result
        result' <- (wrapObject OSTree.ContentWriter.ContentWriter) result
        touchManagedPtr self
        whenJust xattrs touchManagedPtr
        freeMem maybeExpectedChecksum
        return result'
     ) (do
        freeMem maybeExpectedChecksum
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteRegfileMethodInfo
instance (signature ~ (Maybe (T.Text) -> Word32 -> Word32 -> Word32 -> Word64 -> Maybe (GVariant) -> m OSTree.ContentWriter.ContentWriter), MonadIO m, IsRepo a) => O.OverloadedMethod RepoWriteRegfileMethodInfo a signature where
    overloadedMethod = repoWriteRegfile

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


#endif

-- method Repo::write_regfile_inline
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "expected_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The expected checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uid"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "gid"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Group id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mode"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "File mode" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "xattrs"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Extended attributes, GVariant of type (ayay)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 7 (TBasicType TUInt8)
--           , argCType = Just "const guint8*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "File contents" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "len"
--           , argType = TBasicType TSize
--           , argCType = Just "gsize"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TSize
--              , argCType = Just "gsize"
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , argCallbackUserData = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TUTF8)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_write_regfile_inline" ostree_repo_write_regfile_inline :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- expected_checksum : TBasicType TUTF8
    Word32 ->                               -- uid : TBasicType TUInt32
    Word32 ->                               -- gid : TBasicType TUInt32
    Word32 ->                               -- mode : TBasicType TUInt32
    Ptr GVariant ->                         -- xattrs : TVariant
    Ptr Word8 ->                            -- buf : TCArray False (-1) 7 (TBasicType TUInt8)
    FCT.CSize ->                            -- len : TBasicType TSize
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CString

-- | Synchronously create a file object from the provided content.  This API
-- is intended for small files where it is reasonable to buffer the entire
-- content in memory.
-- 
-- Unlike @ostree_repo_write_content()@, if /@expectedChecksum@/ is provided,
-- this function will not check for the presence of the object beforehand.
-- 
-- /Since: 2021.2/
repoWriteRegfileInline ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: repo
    -> Maybe (T.Text)
    -- ^ /@expectedChecksum@/: The expected checksum
    -> Word32
    -- ^ /@uid@/: User id
    -> Word32
    -- ^ /@gid@/: Group id
    -> Word32
    -- ^ /@mode@/: File mode
    -> Maybe (GVariant)
    -- ^ /@xattrs@/: Extended attributes, GVariant of type (ayay)
    -> ByteString
    -- ^ /@buf@/: File contents
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m T.Text
    -- ^ __Returns:__ Checksum (as a hex string) of the committed file /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteRegfileInline :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> Maybe Text
-> Word32
-> Word32
-> Word32
-> Maybe GVariant
-> ByteString
-> Maybe b
-> m Text
repoWriteRegfileInline a
self Maybe Text
expectedChecksum Word32
uid Word32
gid Word32
mode Maybe GVariant
xattrs ByteString
buf Maybe b
cancellable = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    let len :: CSize
len = Int -> CSize
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CSize) -> Int -> CSize
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
buf
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeExpectedChecksum <- case expectedChecksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jExpectedChecksum -> do
            jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
            return jExpectedChecksum'
    maybeXattrs <- case xattrs of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jXattrs -> do
            jXattrs' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jXattrs
            return jXattrs'
    buf' <- packByteString buf
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_write_regfile_inline self' maybeExpectedChecksum uid gid mode maybeXattrs buf' len maybeCancellable
        checkUnexpectedReturnNULL "repoWriteRegfileInline" result
        result' <- cstringToText result
        freeMem result
        touchManagedPtr self
        whenJust xattrs touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem maybeExpectedChecksum
        freeMem buf'
        return result'
     ) (do
        freeMem maybeExpectedChecksum
        freeMem buf'
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteRegfileInlineMethodInfo
instance (signature ~ (Maybe (T.Text) -> Word32 -> Word32 -> Word32 -> Maybe (GVariant) -> ByteString -> Maybe (b) -> m T.Text), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoWriteRegfileInlineMethodInfo a signature where
    overloadedMethod = repoWriteRegfileInline

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


#endif

-- method Repo::write_symlink
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "repo" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "expected_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The expected checksum"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uid"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "gid"
--           , argType = TBasicType TUInt32
--           , argCType = Just "guint32"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Group id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "xattrs"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Extended attributes, GVariant of type (ayay)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "symlink_target"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Target of the symbolic link"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_write_symlink" ostree_repo_write_symlink :: 
    Ptr Repo ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- expected_checksum : TBasicType TUTF8
    Word32 ->                               -- uid : TBasicType TUInt32
    Word32 ->                               -- gid : TBasicType TUInt32
    Ptr GVariant ->                         -- xattrs : TVariant
    CString ->                              -- symlink_target : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CString

-- | Synchronously create a symlink object.
-- 
-- Unlike @ostree_repo_write_content()@, if /@expectedChecksum@/ is provided,
-- this function will not check for the presence of the object beforehand.
-- 
-- /Since: 2021.2/
repoWriteSymlink ::
    (B.CallStack.HasCallStack, MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: repo
    -> Maybe (T.Text)
    -- ^ /@expectedChecksum@/: The expected checksum
    -> Word32
    -- ^ /@uid@/: User id
    -> Word32
    -- ^ /@gid@/: Group id
    -> Maybe (GVariant)
    -- ^ /@xattrs@/: Extended attributes, GVariant of type (ayay)
    -> T.Text
    -- ^ /@symlinkTarget@/: Target of the symbolic link
    -> Maybe (b)
    -- ^ /@cancellable@/: Cancellable
    -> m T.Text
    -- ^ __Returns:__ Checksum (as a hex string) of the committed file /(Can throw 'Data.GI.Base.GError.GError')/
repoWriteSymlink :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsRepo a, IsCancellable b) =>
a
-> Maybe Text
-> Word32
-> Word32
-> Maybe GVariant
-> Text
-> Maybe b
-> m Text
repoWriteSymlink a
self Maybe Text
expectedChecksum Word32
uid Word32
gid Maybe GVariant
xattrs Text
symlinkTarget Maybe b
cancellable = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Repo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    maybeExpectedChecksum <- case expectedChecksum of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
        Just Text
jExpectedChecksum -> do
            jExpectedChecksum' <- Text -> IO CString
textToCString Text
jExpectedChecksum
            return jExpectedChecksum'
    maybeXattrs <- case xattrs of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jXattrs -> do
            jXattrs' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jXattrs
            return jXattrs'
    symlinkTarget' <- textToCString symlinkTarget
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_write_symlink self' maybeExpectedChecksum uid gid maybeXattrs symlinkTarget' maybeCancellable
        checkUnexpectedReturnNULL "repoWriteSymlink" result
        result' <- cstringToText result
        freeMem result
        touchManagedPtr self
        whenJust xattrs touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem maybeExpectedChecksum
        freeMem symlinkTarget'
        return result'
     ) (do
        freeMem maybeExpectedChecksum
        freeMem symlinkTarget'
     )

#if defined(ENABLE_OVERLOADING)
data RepoWriteSymlinkMethodInfo
instance (signature ~ (Maybe (T.Text) -> Word32 -> Word32 -> Maybe (GVariant) -> T.Text -> Maybe (b) -> m T.Text), MonadIO m, IsRepo a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod RepoWriteSymlinkMethodInfo a signature where
    overloadedMethod = repoWriteSymlink

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


#endif

-- method Repo::create_at
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "dfd"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Directory fd" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Path" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mode"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoMode" }
--           , argCType = Just "OstreeRepoMode"
--           , 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
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a{sv}: See below for accepted keys"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Cancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "OSTree" , name = "Repo" })
-- throws : True
-- Skip return : False

foreign import ccall "ostree_repo_create_at" ostree_repo_create_at :: 
    Int32 ->                                -- dfd : TBasicType TInt
    CString ->                              -- path : TBasicType TUTF8
    CUInt ->                                -- mode : TInterface (Name {namespace = "OSTree", name = "RepoMode"})
    Ptr GVariant ->                         -- options : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Repo)

-- | This is a file-descriptor relative version of 'GI.OSTree.Objects.Repo.repoCreate'.
-- Create the underlying structure on disk for the repository, and call
-- 'GI.OSTree.Objects.Repo.repoOpenAt' on the result, preparing it for use.
-- 
-- If a repository already exists at /@dfd@/ + /@path@/ (defined by an @objects\/@
-- subdirectory existing), then this function will simply call
-- 'GI.OSTree.Objects.Repo.repoOpenAt'.  In other words, this function cannot be used to change
-- the mode or configuration (@repo\/config@) of an existing repo.
-- 
-- The /@options@/ dict may contain:
-- 
-- * collection-id: s: Set as collection ID in repo\/config (Since 2017.9)
-- 
-- 
-- /Since: 2017.10/
repoCreateAt ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    Int32
    -- ^ /@dfd@/: Directory fd
    -> T.Text
    -- ^ /@path@/: Path
    -> OSTree.Enums.RepoMode
    -- ^ /@mode@/: The mode to store the repository in
    -> Maybe (GVariant)
    -- ^ /@options@/: a{sv}: See below for accepted keys
    -> Maybe (a)
    -- ^ /@cancellable@/: Cancellable
    -> m Repo
    -- ^ __Returns:__ A new OSTree repository reference /(Can throw 'Data.GI.Base.GError.GError')/
repoCreateAt :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
Int32 -> Text -> RepoMode -> Maybe GVariant -> Maybe a -> m Repo
repoCreateAt Int32
dfd Text
path RepoMode
mode Maybe GVariant
options Maybe a
cancellable = IO Repo -> m Repo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
    path' <- Text -> IO CString
textToCString Text
path
    let mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (RepoMode -> Int) -> RepoMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoMode -> Int
forall a. Enum a => a -> Int
fromEnum) RepoMode
mode
    maybeOptions <- case options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            return jOptions'
    maybeCancellable <- case cancellable of
        Maybe a
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just a
jCancellable -> do
            jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_create_at dfd path' mode' maybeOptions maybeCancellable
        checkUnexpectedReturnNULL "repoCreateAt" result
        result' <- (wrapObject Repo) result
        whenJust options touchManagedPtr
        whenJust cancellable touchManagedPtr
        freeMem path'
        return result'
     ) (do
        freeMem path'
     )

#if defined(ENABLE_OVERLOADING)
#endif

-- method Repo::mode_from_string
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "mode"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const char*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a repo mode as a string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_mode"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "RepoMode" }
--           , argCType = Just "OstreeRepoMode*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the corresponding #OstreeRepoMode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- 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
    Ptr 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
    -- ^ /@mode@/: a repo mode as a string
    -> m (OSTree.Enums.RepoMode)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
repoModeFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m RepoMode
repoModeFromString Text
mode = IO RepoMode -> m RepoMode
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoMode -> m RepoMode) -> IO RepoMode -> m RepoMode
forall a b. (a -> b) -> a -> b
$ do
    mode' <- Text -> IO CString
textToCString Text
mode
    outMode <- allocMem :: IO (Ptr CUInt)
    onException (do
        _ <- propagateGError $ ostree_repo_mode_from_string mode' outMode
        outMode' <- peek outMode
        let outMode'' = (Int -> RepoMode
forall a. Enum a => Int -> a
toEnum (Int -> RepoMode) -> (CUInt -> Int) -> CUInt -> RepoMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
outMode'
        freeMem mode'
        freeMem outMode
        return outMode''
     ) (do
        freeMem mode'
        freeMem outMode
     )

#if defined(ENABLE_OVERLOADING)
#endif

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

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

-- | This combines 'GI.OSTree.Objects.Repo.repoNew' (but using fd-relative access) with
-- 'GI.OSTree.Objects.Repo.repoOpen'.  Use this when you know you should be operating on an
-- already extant repository.  If you want to create one, use 'GI.OSTree.Objects.Repo.repoCreateAt'.
-- 
-- /Since: 2017.10/
repoOpenAt ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    Int32
    -- ^ /@dfd@/: Directory fd
    -> T.Text
    -- ^ /@path@/: Path
    -> Maybe (a)
    -> m Repo
    -- ^ __Returns:__ An accessor object for an OSTree repository located at /@dfd@/ + /@path@/ /(Can throw 'Data.GI.Base.GError.GError')/
repoOpenAt :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
Int32 -> Text -> Maybe a -> m Repo
repoOpenAt Int32
dfd Text
path Maybe a
cancellable = IO Repo -> m Repo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Repo -> m Repo) -> IO Repo -> m Repo
forall a b. (a -> b) -> a -> b
$ do
    path' <- Text -> IO CString
textToCString Text
path
    maybeCancellable <- case cancellable of
        Maybe a
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just a
jCancellable -> do
            jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ ostree_repo_open_at dfd path' maybeCancellable
        checkUnexpectedReturnNULL "repoOpenAt" result
        result' <- (wrapObject Repo) result
        whenJust cancellable touchManagedPtr
        freeMem path'
        return result'
     ) (do
        freeMem path'
     )

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "ostree_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
-- @/ostree_async_progress_new_and_connect()/@ when pulling from a remote
-- repository.
-- 
-- Depending on the state of the t'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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncProgress a) =>
a -> Ptr () -> m ()
repoPullDefaultConsoleProgressChanged a
progress Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    progress' <- a -> IO (Ptr AsyncProgress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
progress
    ostree_repo_pull_default_console_progress_changed progress' userData
    touchManagedPtr progress
    return ()

#if defined(ENABLE_OVERLOADING)
#endif

-- XXX Could not generate method Repo::traverse_new_parents
-- Not implemented: GHashTable element of type TVariant unsupported.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data RepoTraverseNewParentsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "traverseNewParents" Repo) => O.OverloadedMethod RepoTraverseNewParentsMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "traverseNewParents" Repo) => O.OverloadedMethodInfo RepoTraverseNewParentsMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Repo::traverse_new_reachable
-- Not implemented: GHashTable element of type TVariant unsupported.
#if defined(ENABLE_OVERLOADING)
-- 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.UnsupportedMethodError "traverseNewReachable" Repo) => O.OverloadedMethod RepoTraverseNewReachableMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "traverseNewReachable" Repo) => O.OverloadedMethodInfo RepoTraverseNewReachableMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- method Repo::traverse_parents_get_commits
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "parents"
--           , argType = TGHash (TBasicType TPtr) (TBasicType TPtr)
--           , argCType = Just "GHashTable*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_repo_traverse_parents_get_commits" ostree_repo_traverse_parents_get_commits :: 
    Ptr (GHashTable (Ptr ()) (Ptr ())) ->   -- parents : TGHash (TBasicType TPtr) (TBasicType TPtr)
    Ptr GVariant ->                         -- object : TVariant
    IO (Ptr CString)

-- | Gets all the commits that a certain object belongs to, as recorded
-- by a parents table gotten from ostree_repo_traverse_commit_union_with_parents.
-- 
-- /Since: 2018.5/
repoTraverseParentsGetCommits ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Map.Map (Ptr ()) (Ptr ())
    -> GVariant
    -> m [T.Text]
    -- ^ __Returns:__ An array of checksums for
    -- the commits the key belongs to.
repoTraverseParentsGetCommits :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Map (Ptr ()) (Ptr ()) -> GVariant -> m [Text]
repoTraverseParentsGetCommits Map (Ptr ()) (Ptr ())
parents GVariant
object = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    let parents' :: [(Ptr (), Ptr ())]
parents' = Map (Ptr ()) (Ptr ()) -> [(Ptr (), Ptr ())]
forall k a. Map k a -> [(k, a)]
Map.toList Map (Ptr ()) (Ptr ())
parents
    let parents'' :: [(PtrWrapped (Ptr ()), Ptr ())]
parents'' = (Ptr () -> PtrWrapped (Ptr ()))
-> [(Ptr (), Ptr ())] -> [(PtrWrapped (Ptr ()), Ptr ())]
forall a c b. (a -> c) -> [(a, b)] -> [(c, b)]
mapFirst Ptr () -> PtrWrapped (Ptr ())
forall a. Ptr a -> PtrWrapped (Ptr a)
B.GHT.ptrPackPtr [(Ptr (), Ptr ())]
parents'
    let parents''' :: [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
parents''' = (Ptr () -> PtrWrapped (Ptr ()))
-> [(PtrWrapped (Ptr ()), Ptr ())]
-> [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
forall b c a. (b -> c) -> [(a, b)] -> [(a, c)]
mapSecond Ptr () -> PtrWrapped (Ptr ())
forall a. Ptr a -> PtrWrapped (Ptr a)
B.GHT.ptrPackPtr [(PtrWrapped (Ptr ()), Ptr ())]
parents''
    parents'''' <- GHashFunc (Ptr ())
-> GEqualFunc (Ptr ())
-> Maybe (GDestroyNotify (Ptr ()))
-> Maybe (GDestroyNotify (Ptr ()))
-> [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
-> IO (Ptr (GHashTable (Ptr ()) (Ptr ())))
forall a b.
GHashFunc a
-> GEqualFunc a
-> Maybe (GDestroyNotify a)
-> Maybe (GDestroyNotify b)
-> [(PtrWrapped a, PtrWrapped b)]
-> IO (Ptr (GHashTable a b))
packGHashTable GHashFunc (Ptr ())
forall a. GHashFunc (Ptr a)
gDirectHash GEqualFunc (Ptr ())
forall a. GEqualFunc (Ptr a)
gDirectEqual Maybe (GDestroyNotify (Ptr ()))
forall a. Maybe a
Nothing Maybe (GDestroyNotify (Ptr ()))
forall a. Maybe a
Nothing [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
parents'''
    object' <- unsafeManagedPtrGetPtr object
    result <- ostree_repo_traverse_parents_get_commits parents'''' object'
    checkUnexpectedReturnNULL "repoTraverseParentsGetCommits" result
    result' <- unpackZeroTerminatedUTF8CArray result
    mapZeroTerminatedCArray freeMem result
    freeMem result
    touchManagedPtr object
    unrefGHashTable parents''''
    return result'

#if defined(ENABLE_OVERLOADING)
#endif