{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- 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.Structs.DiffItem
    (

-- * Exported types
    DiffItem(..)                            ,
    newZeroDiffItem                         ,
    noDiffItem                              ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveDiffItemMethod                   ,
#endif


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    DiffItemRefMethodInfo                   ,
#endif
    diffItemRef                             ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    DiffItemUnrefMethodInfo                 ,
#endif
    diffItemUnref                           ,




 -- * Properties
-- ** refcount #attr:refcount#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    diffItem_refcount                       ,
#endif
    getDiffItemRefcount                     ,
    setDiffItemRefcount                     ,


-- ** src #attr:src#
-- | /No description available in the introspection data./

    clearDiffItemSrc                        ,
#if defined(ENABLE_OVERLOADING)
    diffItem_src                            ,
#endif
    getDiffItemSrc                          ,
    setDiffItemSrc                          ,


-- ** srcChecksum #attr:srcChecksum#
-- | /No description available in the introspection data./

    clearDiffItemSrcChecksum                ,
#if defined(ENABLE_OVERLOADING)
    diffItem_srcChecksum                    ,
#endif
    getDiffItemSrcChecksum                  ,
    setDiffItemSrcChecksum                  ,


-- ** srcInfo #attr:srcInfo#
-- | /No description available in the introspection data./

    clearDiffItemSrcInfo                    ,
#if defined(ENABLE_OVERLOADING)
    diffItem_srcInfo                        ,
#endif
    getDiffItemSrcInfo                      ,
    setDiffItemSrcInfo                      ,


-- ** target #attr:target#
-- | /No description available in the introspection data./

    clearDiffItemTarget                     ,
#if defined(ENABLE_OVERLOADING)
    diffItem_target                         ,
#endif
    getDiffItemTarget                       ,
    setDiffItemTarget                       ,


-- ** targetChecksum #attr:targetChecksum#
-- | /No description available in the introspection data./

    clearDiffItemTargetChecksum             ,
#if defined(ENABLE_OVERLOADING)
    diffItem_targetChecksum                 ,
#endif
    getDiffItemTargetChecksum               ,
    setDiffItemTargetChecksum               ,


-- ** targetInfo #attr:targetInfo#
-- | /No description available in the introspection data./

    clearDiffItemTargetInfo                 ,
#if defined(ENABLE_OVERLOADING)
    diffItem_targetInfo                     ,
#endif
    getDiffItemTargetInfo                   ,
    setDiffItemTargetInfo                   ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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 Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo

-- | Memory-managed wrapper type.
newtype DiffItem = DiffItem (ManagedPtr DiffItem)
    deriving (Eq)
foreign import ccall "ostree_diff_item_get_type" c_ostree_diff_item_get_type ::
    IO GType

instance BoxedObject DiffItem where
    boxedType _ = c_ostree_diff_item_get_type

-- | Convert 'DiffItem' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue DiffItem where
    toGValue o = do
        gtype <- c_ostree_diff_item_get_type
        B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_boxed)

    fromGValue gv = do
        ptr <- B.GValue.get_boxed gv :: IO (Ptr DiffItem)
        B.ManagedPtr.newBoxed DiffItem ptr



-- | Construct a `DiffItem` struct initialized to zero.
newZeroDiffItem :: MonadIO m => m DiffItem
newZeroDiffItem = liftIO $ callocBoxedBytes 28 >>= wrapBoxed DiffItem

instance tag ~ 'AttrSet => Constructible DiffItem tag where
    new _ attrs = do
        o <- newZeroDiffItem
        GI.Attributes.set o attrs
        return o


-- | A convenience alias for `Nothing` :: `Maybe` `DiffItem`.
noDiffItem :: Maybe DiffItem
noDiffItem = Nothing

-- | Get the value of the “@refcount@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diffItem #refcount
-- @
getDiffItemRefcount :: MonadIO m => DiffItem -> m Int32
getDiffItemRefcount s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO Int32
    return val

-- | Set the value of the “@refcount@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' diffItem [ #refcount 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiffItemRefcount :: MonadIO m => DiffItem -> Int32 -> m ()
setDiffItemRefcount s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (val :: Int32)

#if defined(ENABLE_OVERLOADING)
data DiffItemRefcountFieldInfo
instance AttrInfo DiffItemRefcountFieldInfo where
    type AttrBaseTypeConstraint DiffItemRefcountFieldInfo = (~) DiffItem
    type AttrAllowedOps DiffItemRefcountFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint DiffItemRefcountFieldInfo = (~) Int32
    type AttrTransferTypeConstraint DiffItemRefcountFieldInfo = (~)Int32
    type AttrTransferType DiffItemRefcountFieldInfo = Int32
    type AttrGetType DiffItemRefcountFieldInfo = Int32
    type AttrLabel DiffItemRefcountFieldInfo = "refcount"
    type AttrOrigin DiffItemRefcountFieldInfo = DiffItem
    attrGet = getDiffItemRefcount
    attrSet = setDiffItemRefcount
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v

diffItem_refcount :: AttrLabelProxy "refcount"
diffItem_refcount = AttrLabelProxy

#endif


-- | Get the value of the “@src@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diffItem #src
-- @
getDiffItemSrc :: MonadIO m => DiffItem -> m (Maybe Gio.File.File)
getDiffItemSrc s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 4) :: IO (Ptr Gio.File.File)
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- (newObject Gio.File.File) val'
        return val''
    return result

-- | Set the value of the “@src@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' diffItem [ #src 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiffItemSrc :: MonadIO m => DiffItem -> Ptr Gio.File.File -> m ()
setDiffItemSrc s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 4) (val :: Ptr Gio.File.File)

-- | Set the value of the “@src@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #src
-- @
clearDiffItemSrc :: MonadIO m => DiffItem -> m ()
clearDiffItemSrc s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 4) (FP.nullPtr :: Ptr Gio.File.File)

#if defined(ENABLE_OVERLOADING)
data DiffItemSrcFieldInfo
instance AttrInfo DiffItemSrcFieldInfo where
    type AttrBaseTypeConstraint DiffItemSrcFieldInfo = (~) DiffItem
    type AttrAllowedOps DiffItemSrcFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DiffItemSrcFieldInfo = (~) (Ptr Gio.File.File)
    type AttrTransferTypeConstraint DiffItemSrcFieldInfo = (~)(Ptr Gio.File.File)
    type AttrTransferType DiffItemSrcFieldInfo = (Ptr Gio.File.File)
    type AttrGetType DiffItemSrcFieldInfo = Maybe Gio.File.File
    type AttrLabel DiffItemSrcFieldInfo = "src"
    type AttrOrigin DiffItemSrcFieldInfo = DiffItem
    attrGet = getDiffItemSrc
    attrSet = setDiffItemSrc
    attrConstruct = undefined
    attrClear = clearDiffItemSrc
    attrTransfer _ v = do
        return v

diffItem_src :: AttrLabelProxy "src"
diffItem_src = AttrLabelProxy

#endif


-- | Get the value of the “@target@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diffItem #target
-- @
getDiffItemTarget :: MonadIO m => DiffItem -> m (Maybe Gio.File.File)
getDiffItemTarget s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO (Ptr Gio.File.File)
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- (newObject Gio.File.File) val'
        return val''
    return result

-- | Set the value of the “@target@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' diffItem [ #target 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiffItemTarget :: MonadIO m => DiffItem -> Ptr Gio.File.File -> m ()
setDiffItemTarget s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (val :: Ptr Gio.File.File)

-- | Set the value of the “@target@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #target
-- @
clearDiffItemTarget :: MonadIO m => DiffItem -> m ()
clearDiffItemTarget s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (FP.nullPtr :: Ptr Gio.File.File)

#if defined(ENABLE_OVERLOADING)
data DiffItemTargetFieldInfo
instance AttrInfo DiffItemTargetFieldInfo where
    type AttrBaseTypeConstraint DiffItemTargetFieldInfo = (~) DiffItem
    type AttrAllowedOps DiffItemTargetFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DiffItemTargetFieldInfo = (~) (Ptr Gio.File.File)
    type AttrTransferTypeConstraint DiffItemTargetFieldInfo = (~)(Ptr Gio.File.File)
    type AttrTransferType DiffItemTargetFieldInfo = (Ptr Gio.File.File)
    type AttrGetType DiffItemTargetFieldInfo = Maybe Gio.File.File
    type AttrLabel DiffItemTargetFieldInfo = "target"
    type AttrOrigin DiffItemTargetFieldInfo = DiffItem
    attrGet = getDiffItemTarget
    attrSet = setDiffItemTarget
    attrConstruct = undefined
    attrClear = clearDiffItemTarget
    attrTransfer _ v = do
        return v

diffItem_target :: AttrLabelProxy "target"
diffItem_target = AttrLabelProxy

#endif


-- | Get the value of the “@src_info@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diffItem #srcInfo
-- @
getDiffItemSrcInfo :: MonadIO m => DiffItem -> m (Maybe Gio.FileInfo.FileInfo)
getDiffItemSrcInfo s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 12) :: IO (Ptr Gio.FileInfo.FileInfo)
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- (newObject Gio.FileInfo.FileInfo) val'
        return val''
    return result

-- | Set the value of the “@src_info@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' diffItem [ #srcInfo 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiffItemSrcInfo :: MonadIO m => DiffItem -> Ptr Gio.FileInfo.FileInfo -> m ()
setDiffItemSrcInfo s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 12) (val :: Ptr Gio.FileInfo.FileInfo)

-- | Set the value of the “@src_info@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #srcInfo
-- @
clearDiffItemSrcInfo :: MonadIO m => DiffItem -> m ()
clearDiffItemSrcInfo s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 12) (FP.nullPtr :: Ptr Gio.FileInfo.FileInfo)

#if defined(ENABLE_OVERLOADING)
data DiffItemSrcInfoFieldInfo
instance AttrInfo DiffItemSrcInfoFieldInfo where
    type AttrBaseTypeConstraint DiffItemSrcInfoFieldInfo = (~) DiffItem
    type AttrAllowedOps DiffItemSrcInfoFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DiffItemSrcInfoFieldInfo = (~) (Ptr Gio.FileInfo.FileInfo)
    type AttrTransferTypeConstraint DiffItemSrcInfoFieldInfo = (~)(Ptr Gio.FileInfo.FileInfo)
    type AttrTransferType DiffItemSrcInfoFieldInfo = (Ptr Gio.FileInfo.FileInfo)
    type AttrGetType DiffItemSrcInfoFieldInfo = Maybe Gio.FileInfo.FileInfo
    type AttrLabel DiffItemSrcInfoFieldInfo = "src_info"
    type AttrOrigin DiffItemSrcInfoFieldInfo = DiffItem
    attrGet = getDiffItemSrcInfo
    attrSet = setDiffItemSrcInfo
    attrConstruct = undefined
    attrClear = clearDiffItemSrcInfo
    attrTransfer _ v = do
        return v

diffItem_srcInfo :: AttrLabelProxy "srcInfo"
diffItem_srcInfo = AttrLabelProxy

#endif


-- | Get the value of the “@target_info@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diffItem #targetInfo
-- @
getDiffItemTargetInfo :: MonadIO m => DiffItem -> m (Maybe Gio.FileInfo.FileInfo)
getDiffItemTargetInfo s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO (Ptr Gio.FileInfo.FileInfo)
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- (newObject Gio.FileInfo.FileInfo) val'
        return val''
    return result

-- | Set the value of the “@target_info@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' diffItem [ #targetInfo 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiffItemTargetInfo :: MonadIO m => DiffItem -> Ptr Gio.FileInfo.FileInfo -> m ()
setDiffItemTargetInfo s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (val :: Ptr Gio.FileInfo.FileInfo)

-- | Set the value of the “@target_info@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #targetInfo
-- @
clearDiffItemTargetInfo :: MonadIO m => DiffItem -> m ()
clearDiffItemTargetInfo s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (FP.nullPtr :: Ptr Gio.FileInfo.FileInfo)

#if defined(ENABLE_OVERLOADING)
data DiffItemTargetInfoFieldInfo
instance AttrInfo DiffItemTargetInfoFieldInfo where
    type AttrBaseTypeConstraint DiffItemTargetInfoFieldInfo = (~) DiffItem
    type AttrAllowedOps DiffItemTargetInfoFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DiffItemTargetInfoFieldInfo = (~) (Ptr Gio.FileInfo.FileInfo)
    type AttrTransferTypeConstraint DiffItemTargetInfoFieldInfo = (~)(Ptr Gio.FileInfo.FileInfo)
    type AttrTransferType DiffItemTargetInfoFieldInfo = (Ptr Gio.FileInfo.FileInfo)
    type AttrGetType DiffItemTargetInfoFieldInfo = Maybe Gio.FileInfo.FileInfo
    type AttrLabel DiffItemTargetInfoFieldInfo = "target_info"
    type AttrOrigin DiffItemTargetInfoFieldInfo = DiffItem
    attrGet = getDiffItemTargetInfo
    attrSet = setDiffItemTargetInfo
    attrConstruct = undefined
    attrClear = clearDiffItemTargetInfo
    attrTransfer _ v = do
        return v

diffItem_targetInfo :: AttrLabelProxy "targetInfo"
diffItem_targetInfo = AttrLabelProxy

#endif


-- | Get the value of the “@src_checksum@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diffItem #srcChecksum
-- @
getDiffItemSrcChecksum :: MonadIO m => DiffItem -> m (Maybe T.Text)
getDiffItemSrcChecksum s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 20) :: IO CString
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- cstringToText val'
        return val''
    return result

-- | Set the value of the “@src_checksum@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' diffItem [ #srcChecksum 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiffItemSrcChecksum :: MonadIO m => DiffItem -> CString -> m ()
setDiffItemSrcChecksum s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 20) (val :: CString)

-- | Set the value of the “@src_checksum@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #srcChecksum
-- @
clearDiffItemSrcChecksum :: MonadIO m => DiffItem -> m ()
clearDiffItemSrcChecksum s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 20) (FP.nullPtr :: CString)

#if defined(ENABLE_OVERLOADING)
data DiffItemSrcChecksumFieldInfo
instance AttrInfo DiffItemSrcChecksumFieldInfo where
    type AttrBaseTypeConstraint DiffItemSrcChecksumFieldInfo = (~) DiffItem
    type AttrAllowedOps DiffItemSrcChecksumFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DiffItemSrcChecksumFieldInfo = (~) CString
    type AttrTransferTypeConstraint DiffItemSrcChecksumFieldInfo = (~)CString
    type AttrTransferType DiffItemSrcChecksumFieldInfo = CString
    type AttrGetType DiffItemSrcChecksumFieldInfo = Maybe T.Text
    type AttrLabel DiffItemSrcChecksumFieldInfo = "src_checksum"
    type AttrOrigin DiffItemSrcChecksumFieldInfo = DiffItem
    attrGet = getDiffItemSrcChecksum
    attrSet = setDiffItemSrcChecksum
    attrConstruct = undefined
    attrClear = clearDiffItemSrcChecksum
    attrTransfer _ v = do
        return v

diffItem_srcChecksum :: AttrLabelProxy "srcChecksum"
diffItem_srcChecksum = AttrLabelProxy

#endif


-- | Get the value of the “@target_checksum@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' diffItem #targetChecksum
-- @
getDiffItemTargetChecksum :: MonadIO m => DiffItem -> m (Maybe T.Text)
getDiffItemTargetChecksum s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO CString
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- cstringToText val'
        return val''
    return result

-- | Set the value of the “@target_checksum@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' diffItem [ #targetChecksum 'Data.GI.Base.Attributes.:=' value ]
-- @
setDiffItemTargetChecksum :: MonadIO m => DiffItem -> CString -> m ()
setDiffItemTargetChecksum s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (val :: CString)

-- | Set the value of the “@target_checksum@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #targetChecksum
-- @
clearDiffItemTargetChecksum :: MonadIO m => DiffItem -> m ()
clearDiffItemTargetChecksum s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (FP.nullPtr :: CString)

#if defined(ENABLE_OVERLOADING)
data DiffItemTargetChecksumFieldInfo
instance AttrInfo DiffItemTargetChecksumFieldInfo where
    type AttrBaseTypeConstraint DiffItemTargetChecksumFieldInfo = (~) DiffItem
    type AttrAllowedOps DiffItemTargetChecksumFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DiffItemTargetChecksumFieldInfo = (~) CString
    type AttrTransferTypeConstraint DiffItemTargetChecksumFieldInfo = (~)CString
    type AttrTransferType DiffItemTargetChecksumFieldInfo = CString
    type AttrGetType DiffItemTargetChecksumFieldInfo = Maybe T.Text
    type AttrLabel DiffItemTargetChecksumFieldInfo = "target_checksum"
    type AttrOrigin DiffItemTargetChecksumFieldInfo = DiffItem
    attrGet = getDiffItemTargetChecksum
    attrSet = setDiffItemTargetChecksum
    attrConstruct = undefined
    attrClear = clearDiffItemTargetChecksum
    attrTransfer _ v = do
        return v

diffItem_targetChecksum :: AttrLabelProxy "targetChecksum"
diffItem_targetChecksum = AttrLabelProxy

#endif



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DiffItem
type instance O.AttributeList DiffItem = DiffItemAttributeList
type DiffItemAttributeList = ('[ '("refcount", DiffItemRefcountFieldInfo), '("src", DiffItemSrcFieldInfo), '("target", DiffItemTargetFieldInfo), '("srcInfo", DiffItemSrcInfoFieldInfo), '("targetInfo", DiffItemTargetInfoFieldInfo), '("srcChecksum", DiffItemSrcChecksumFieldInfo), '("targetChecksum", DiffItemTargetChecksumFieldInfo)] :: [(Symbol, *)])
#endif

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

foreign import ccall "ostree_diff_item_ref" ostree_diff_item_ref ::
    Ptr DiffItem ->                         -- diffitem : TInterface (Name {namespace = "OSTree", name = "DiffItem"})
    IO (Ptr DiffItem)

-- | /No description available in the introspection data./
diffItemRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DiffItem
    -> m DiffItem
diffItemRef diffitem = liftIO $ do
    diffitem' <- unsafeManagedPtrGetPtr diffitem
    result <- ostree_diff_item_ref diffitem'
    checkUnexpectedReturnNULL "diffItemRef" result
    result' <- (wrapBoxed DiffItem) result
    touchManagedPtr diffitem
    return result'

#if defined(ENABLE_OVERLOADING)
data DiffItemRefMethodInfo
instance (signature ~ (m DiffItem), MonadIO m) => O.MethodInfo DiffItemRefMethodInfo DiffItem signature where
    overloadedMethod = diffItemRef

#endif

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

foreign import ccall "ostree_diff_item_unref" ostree_diff_item_unref ::
    Ptr DiffItem ->                         -- diffitem : TInterface (Name {namespace = "OSTree", name = "DiffItem"})
    IO ()

-- | /No description available in the introspection data./
diffItemUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DiffItem
    -> m ()
diffItemUnref diffitem = liftIO $ do
    diffitem' <- unsafeManagedPtrGetPtr diffitem
    ostree_diff_item_unref diffitem'
    touchManagedPtr diffitem
    return ()

#if defined(ENABLE_OVERLOADING)
data DiffItemUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DiffItemUnrefMethodInfo DiffItem signature where
    overloadedMethod = diffItemUnref

#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveDiffItemMethod (t :: Symbol) (o :: *) :: * where
    ResolveDiffItemMethod "ref" o = DiffItemRefMethodInfo
    ResolveDiffItemMethod "unref" o = DiffItemUnrefMethodInfo
    ResolveDiffItemMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDiffItemMethod t DiffItem, O.MethodInfo info DiffItem p) => OL.IsLabel t (DiffItem -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif