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

A proxy object representing a secret item in the Secret Service.
-}

module GI.Secret.Objects.Item
    ( 

-- * Exported types
    Item(..)                                ,
    IsItem                                  ,
    toItem                                  ,
    noItem                                  ,


 -- * Methods
-- ** create #method:create#
    itemCreate                              ,


-- ** createFinish #method:createFinish#
    itemCreateFinish                        ,


-- ** createSync #method:createSync#
    itemCreateSync                          ,


-- ** delete #method:delete#
    ItemDeleteMethodInfo                    ,
    itemDelete                              ,


-- ** deleteFinish #method:deleteFinish#
    ItemDeleteFinishMethodInfo              ,
    itemDeleteFinish                        ,


-- ** deleteSync #method:deleteSync#
    ItemDeleteSyncMethodInfo                ,
    itemDeleteSync                          ,


-- ** getAttributes #method:getAttributes#
    ItemGetAttributesMethodInfo             ,
    itemGetAttributes                       ,


-- ** getCreated #method:getCreated#
    ItemGetCreatedMethodInfo                ,
    itemGetCreated                          ,


-- ** getFlags #method:getFlags#
    ItemGetFlagsMethodInfo                  ,
    itemGetFlags                            ,


-- ** getLabel #method:getLabel#
    ItemGetLabelMethodInfo                  ,
    itemGetLabel                            ,


-- ** getLocked #method:getLocked#
    ItemGetLockedMethodInfo                 ,
    itemGetLocked                           ,


-- ** getModified #method:getModified#
    ItemGetModifiedMethodInfo               ,
    itemGetModified                         ,


-- ** getSchemaName #method:getSchemaName#
    ItemGetSchemaNameMethodInfo             ,
    itemGetSchemaName                       ,


-- ** getSecret #method:getSecret#
    ItemGetSecretMethodInfo                 ,
    itemGetSecret                           ,


-- ** getService #method:getService#
    ItemGetServiceMethodInfo                ,
    itemGetService                          ,


-- ** loadSecret #method:loadSecret#
    ItemLoadSecretMethodInfo                ,
    itemLoadSecret                          ,


-- ** loadSecretFinish #method:loadSecretFinish#
    ItemLoadSecretFinishMethodInfo          ,
    itemLoadSecretFinish                    ,


-- ** loadSecretSync #method:loadSecretSync#
    ItemLoadSecretSyncMethodInfo            ,
    itemLoadSecretSync                      ,


-- ** loadSecrets #method:loadSecrets#
    itemLoadSecrets                         ,


-- ** loadSecretsFinish #method:loadSecretsFinish#
    itemLoadSecretsFinish                   ,


-- ** loadSecretsSync #method:loadSecretsSync#
    itemLoadSecretsSync                     ,


-- ** refresh #method:refresh#
    ItemRefreshMethodInfo                   ,
    itemRefresh                             ,


-- ** setAttributes #method:setAttributes#
    ItemSetAttributesMethodInfo             ,
    itemSetAttributes                       ,


-- ** setAttributesFinish #method:setAttributesFinish#
    ItemSetAttributesFinishMethodInfo       ,
    itemSetAttributesFinish                 ,


-- ** setAttributesSync #method:setAttributesSync#
    ItemSetAttributesSyncMethodInfo         ,
    itemSetAttributesSync                   ,


-- ** setLabel #method:setLabel#
    ItemSetLabelMethodInfo                  ,
    itemSetLabel                            ,


-- ** setLabelFinish #method:setLabelFinish#
    ItemSetLabelFinishMethodInfo            ,
    itemSetLabelFinish                      ,


-- ** setLabelSync #method:setLabelSync#
    ItemSetLabelSyncMethodInfo              ,
    itemSetLabelSync                        ,


-- ** setSecret #method:setSecret#
    ItemSetSecretMethodInfo                 ,
    itemSetSecret                           ,


-- ** setSecretFinish #method:setSecretFinish#
    ItemSetSecretFinishMethodInfo           ,
    itemSetSecretFinish                     ,


-- ** setSecretSync #method:setSecretSync#
    ItemSetSecretSyncMethodInfo             ,
    itemSetSecretSync                       ,




 -- * Properties
-- ** attributes #attr:attributes#
    ItemAttributesPropertyInfo              ,
    itemAttributes                          ,


-- ** created #attr:created#
    ItemCreatedPropertyInfo                 ,
    constructItemCreated                    ,
    getItemCreated                          ,
    itemCreated                             ,
    setItemCreated                          ,


-- ** label #attr:label#
    ItemLabelPropertyInfo                   ,
    clearItemLabel                          ,
    constructItemLabel                      ,
    getItemLabel                            ,
    itemLabel                               ,
    setItemLabel                            ,


-- ** locked #attr:locked#
    ItemLockedPropertyInfo                  ,
    getItemLocked                           ,
    itemLocked                              ,


-- ** modified #attr:modified#
    ItemModifiedPropertyInfo                ,
    constructItemModified                   ,
    getItemModified                         ,
    itemModified                            ,
    setItemModified                         ,


-- ** service #attr:service#
    ItemServicePropertyInfo                 ,
    constructItemService                    ,
    getItemService                          ,
    itemService                             ,




    ) where

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

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

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.DBusInterface as Gio.DBusInterface
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.DBusProxy as Gio.DBusProxy
import {-# SOURCE #-} qualified GI.Secret.Flags as Secret.Flags
import {-# SOURCE #-} qualified GI.Secret.Objects.Collection as Secret.Collection
import {-# SOURCE #-} qualified GI.Secret.Objects.Service as Secret.Service
import {-# SOURCE #-} qualified GI.Secret.Structs.Schema as Secret.Schema
import {-# SOURCE #-} qualified GI.Secret.Structs.Value as Secret.Value

newtype Item = Item (ManagedPtr Item)
foreign import ccall "secret_item_get_type"
    c_secret_item_get_type :: IO GType

instance GObject Item where
    gobjectType _ = c_secret_item_get_type
    

class GObject o => IsItem o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Item a) =>
    IsItem a
#endif
instance IsItem Item
instance Gio.DBusProxy.IsDBusProxy Item
instance GObject.Object.IsObject Item
instance Gio.AsyncInitable.IsAsyncInitable Item
instance Gio.DBusInterface.IsDBusInterface Item
instance Gio.Initable.IsInitable Item

toItem :: IsItem o => o -> IO Item
toItem = unsafeCastTo Item

noItem :: Maybe Item
noItem = Nothing

type family ResolveItemMethod (t :: Symbol) (o :: *) :: * where
    ResolveItemMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveItemMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveItemMethod "call" o = Gio.DBusProxy.DBusProxyCallMethodInfo
    ResolveItemMethod "callFinish" o = Gio.DBusProxy.DBusProxyCallFinishMethodInfo
    ResolveItemMethod "callSync" o = Gio.DBusProxy.DBusProxyCallSyncMethodInfo
    ResolveItemMethod "callWithUnixFdList" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListMethodInfo
    ResolveItemMethod "callWithUnixFdListFinish" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListFinishMethodInfo
    ResolveItemMethod "callWithUnixFdListSync" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListSyncMethodInfo
    ResolveItemMethod "delete" o = ItemDeleteMethodInfo
    ResolveItemMethod "deleteFinish" o = ItemDeleteFinishMethodInfo
    ResolveItemMethod "deleteSync" o = ItemDeleteSyncMethodInfo
    ResolveItemMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveItemMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveItemMethod "init" o = Gio.Initable.InitableInitMethodInfo
    ResolveItemMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
    ResolveItemMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
    ResolveItemMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveItemMethod "loadSecret" o = ItemLoadSecretMethodInfo
    ResolveItemMethod "loadSecretFinish" o = ItemLoadSecretFinishMethodInfo
    ResolveItemMethod "loadSecretSync" o = ItemLoadSecretSyncMethodInfo
    ResolveItemMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveItemMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveItemMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveItemMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveItemMethod "refresh" o = ItemRefreshMethodInfo
    ResolveItemMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveItemMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveItemMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveItemMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveItemMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveItemMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveItemMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveItemMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveItemMethod "getAttributes" o = ItemGetAttributesMethodInfo
    ResolveItemMethod "getCachedProperty" o = Gio.DBusProxy.DBusProxyGetCachedPropertyMethodInfo
    ResolveItemMethod "getCachedPropertyNames" o = Gio.DBusProxy.DBusProxyGetCachedPropertyNamesMethodInfo
    ResolveItemMethod "getConnection" o = Gio.DBusProxy.DBusProxyGetConnectionMethodInfo
    ResolveItemMethod "getCreated" o = ItemGetCreatedMethodInfo
    ResolveItemMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveItemMethod "getDefaultTimeout" o = Gio.DBusProxy.DBusProxyGetDefaultTimeoutMethodInfo
    ResolveItemMethod "getFlags" o = ItemGetFlagsMethodInfo
    ResolveItemMethod "getInfo" o = Gio.DBusInterface.DBusInterfaceGetInfoMethodInfo
    ResolveItemMethod "getInterfaceInfo" o = Gio.DBusProxy.DBusProxyGetInterfaceInfoMethodInfo
    ResolveItemMethod "getInterfaceName" o = Gio.DBusProxy.DBusProxyGetInterfaceNameMethodInfo
    ResolveItemMethod "getLabel" o = ItemGetLabelMethodInfo
    ResolveItemMethod "getLocked" o = ItemGetLockedMethodInfo
    ResolveItemMethod "getModified" o = ItemGetModifiedMethodInfo
    ResolveItemMethod "getName" o = Gio.DBusProxy.DBusProxyGetNameMethodInfo
    ResolveItemMethod "getNameOwner" o = Gio.DBusProxy.DBusProxyGetNameOwnerMethodInfo
    ResolveItemMethod "getObject" o = Gio.DBusInterface.DBusInterfaceGetObjectMethodInfo
    ResolveItemMethod "getObjectPath" o = Gio.DBusProxy.DBusProxyGetObjectPathMethodInfo
    ResolveItemMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveItemMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveItemMethod "getSchemaName" o = ItemGetSchemaNameMethodInfo
    ResolveItemMethod "getSecret" o = ItemGetSecretMethodInfo
    ResolveItemMethod "getService" o = ItemGetServiceMethodInfo
    ResolveItemMethod "setAttributes" o = ItemSetAttributesMethodInfo
    ResolveItemMethod "setAttributesFinish" o = ItemSetAttributesFinishMethodInfo
    ResolveItemMethod "setAttributesSync" o = ItemSetAttributesSyncMethodInfo
    ResolveItemMethod "setCachedProperty" o = Gio.DBusProxy.DBusProxySetCachedPropertyMethodInfo
    ResolveItemMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveItemMethod "setDefaultTimeout" o = Gio.DBusProxy.DBusProxySetDefaultTimeoutMethodInfo
    ResolveItemMethod "setInterfaceInfo" o = Gio.DBusProxy.DBusProxySetInterfaceInfoMethodInfo
    ResolveItemMethod "setLabel" o = ItemSetLabelMethodInfo
    ResolveItemMethod "setLabelFinish" o = ItemSetLabelFinishMethodInfo
    ResolveItemMethod "setLabelSync" o = ItemSetLabelSyncMethodInfo
    ResolveItemMethod "setObject" o = Gio.DBusInterface.DBusInterfaceSetObjectMethodInfo
    ResolveItemMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveItemMethod "setSecret" o = ItemSetSecretMethodInfo
    ResolveItemMethod "setSecretFinish" o = ItemSetSecretFinishMethodInfo
    ResolveItemMethod "setSecretSync" o = ItemSetSecretSyncMethodInfo
    ResolveItemMethod l o = O.MethodResolutionFailed l o

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

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

-- XXX Generation of property "attributes" of object "Item" failed: Not implemented: "Property ItemAttributes has unsupported transfer type TransferEverything"
-- XXX Placeholder
data ItemAttributesPropertyInfo
instance AttrInfo ItemAttributesPropertyInfo where
    type AttrAllowedOps ItemAttributesPropertyInfo = '[]
    type AttrSetTypeConstraint ItemAttributesPropertyInfo = (~) ()
    type AttrBaseTypeConstraint ItemAttributesPropertyInfo = (~) ()
    type AttrGetType ItemAttributesPropertyInfo = ()
    type AttrLabel ItemAttributesPropertyInfo = ""
    type AttrOrigin ItemAttributesPropertyInfo = Item
    attrGet = undefined
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
-- VVV Prop "created"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Nothing)

getItemCreated :: (MonadIO m, IsItem o) => o -> m Word64
getItemCreated obj = liftIO $ getObjectPropertyUInt64 obj "created"

setItemCreated :: (MonadIO m, IsItem o) => o -> Word64 -> m ()
setItemCreated obj val = liftIO $ setObjectPropertyUInt64 obj "created" val

constructItemCreated :: (IsItem o) => Word64 -> IO (GValueConstruct o)
constructItemCreated val = constructObjectPropertyUInt64 "created" val

data ItemCreatedPropertyInfo
instance AttrInfo ItemCreatedPropertyInfo where
    type AttrAllowedOps ItemCreatedPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ItemCreatedPropertyInfo = (~) Word64
    type AttrBaseTypeConstraint ItemCreatedPropertyInfo = IsItem
    type AttrGetType ItemCreatedPropertyInfo = Word64
    type AttrLabel ItemCreatedPropertyInfo = "created"
    type AttrOrigin ItemCreatedPropertyInfo = Item
    attrGet _ = getItemCreated
    attrSet _ = setItemCreated
    attrConstruct _ = constructItemCreated
    attrClear _ = undefined

-- VVV Prop "label"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getItemLabel :: (MonadIO m, IsItem o) => o -> m (Maybe T.Text)
getItemLabel obj = liftIO $ getObjectPropertyString obj "label"

setItemLabel :: (MonadIO m, IsItem o) => o -> T.Text -> m ()
setItemLabel obj val = liftIO $ setObjectPropertyString obj "label" (Just val)

constructItemLabel :: (IsItem o) => T.Text -> IO (GValueConstruct o)
constructItemLabel val = constructObjectPropertyString "label" (Just val)

clearItemLabel :: (MonadIO m, IsItem o) => o -> m ()
clearItemLabel obj = liftIO $ setObjectPropertyString obj "label" (Nothing :: Maybe T.Text)

data ItemLabelPropertyInfo
instance AttrInfo ItemLabelPropertyInfo where
    type AttrAllowedOps ItemLabelPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ItemLabelPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ItemLabelPropertyInfo = IsItem
    type AttrGetType ItemLabelPropertyInfo = (Maybe T.Text)
    type AttrLabel ItemLabelPropertyInfo = "label"
    type AttrOrigin ItemLabelPropertyInfo = Item
    attrGet _ = getItemLabel
    attrSet _ = setItemLabel
    attrConstruct _ = constructItemLabel
    attrClear _ = clearItemLabel

-- VVV Prop "locked"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getItemLocked :: (MonadIO m, IsItem o) => o -> m Bool
getItemLocked obj = liftIO $ getObjectPropertyBool obj "locked"

data ItemLockedPropertyInfo
instance AttrInfo ItemLockedPropertyInfo where
    type AttrAllowedOps ItemLockedPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint ItemLockedPropertyInfo = (~) ()
    type AttrBaseTypeConstraint ItemLockedPropertyInfo = IsItem
    type AttrGetType ItemLockedPropertyInfo = Bool
    type AttrLabel ItemLockedPropertyInfo = "locked"
    type AttrOrigin ItemLockedPropertyInfo = Item
    attrGet _ = getItemLocked
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "modified"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Nothing)

getItemModified :: (MonadIO m, IsItem o) => o -> m Word64
getItemModified obj = liftIO $ getObjectPropertyUInt64 obj "modified"

setItemModified :: (MonadIO m, IsItem o) => o -> Word64 -> m ()
setItemModified obj val = liftIO $ setObjectPropertyUInt64 obj "modified" val

constructItemModified :: (IsItem o) => Word64 -> IO (GValueConstruct o)
constructItemModified val = constructObjectPropertyUInt64 "modified" val

data ItemModifiedPropertyInfo
instance AttrInfo ItemModifiedPropertyInfo where
    type AttrAllowedOps ItemModifiedPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ItemModifiedPropertyInfo = (~) Word64
    type AttrBaseTypeConstraint ItemModifiedPropertyInfo = IsItem
    type AttrGetType ItemModifiedPropertyInfo = Word64
    type AttrLabel ItemModifiedPropertyInfo = "modified"
    type AttrOrigin ItemModifiedPropertyInfo = Item
    attrGet _ = getItemModified
    attrSet _ = setItemModified
    attrConstruct _ = constructItemModified
    attrClear _ = undefined

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

getItemService :: (MonadIO m, IsItem o) => o -> m Secret.Service.Service
getItemService obj = liftIO $ checkUnexpectedNothing "getItemService" $ getObjectPropertyObject obj "service" Secret.Service.Service

constructItemService :: (IsItem o, Secret.Service.IsService a) => a -> IO (GValueConstruct o)
constructItemService val = constructObjectPropertyObject "service" (Just val)

data ItemServicePropertyInfo
instance AttrInfo ItemServicePropertyInfo where
    type AttrAllowedOps ItemServicePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ItemServicePropertyInfo = Secret.Service.IsService
    type AttrBaseTypeConstraint ItemServicePropertyInfo = IsItem
    type AttrGetType ItemServicePropertyInfo = Secret.Service.Service
    type AttrLabel ItemServicePropertyInfo = "service"
    type AttrOrigin ItemServicePropertyInfo = Item
    attrGet _ = getItemService
    attrSet _ = undefined
    attrConstruct _ = constructItemService
    attrClear _ = undefined

instance O.HasAttributeList Item
type instance O.AttributeList Item = ItemAttributeList
type ItemAttributeList = ('[ '("attributes", ItemAttributesPropertyInfo), '("created", ItemCreatedPropertyInfo), '("gBusType", Gio.DBusProxy.DBusProxyGBusTypePropertyInfo), '("gConnection", Gio.DBusProxy.DBusProxyGConnectionPropertyInfo), '("gDefaultTimeout", Gio.DBusProxy.DBusProxyGDefaultTimeoutPropertyInfo), '("gFlags", Gio.DBusProxy.DBusProxyGFlagsPropertyInfo), '("gInterfaceInfo", Gio.DBusProxy.DBusProxyGInterfaceInfoPropertyInfo), '("gInterfaceName", Gio.DBusProxy.DBusProxyGInterfaceNamePropertyInfo), '("gName", Gio.DBusProxy.DBusProxyGNamePropertyInfo), '("gNameOwner", Gio.DBusProxy.DBusProxyGNameOwnerPropertyInfo), '("gObjectPath", Gio.DBusProxy.DBusProxyGObjectPathPropertyInfo), '("label", ItemLabelPropertyInfo), '("locked", ItemLockedPropertyInfo), '("modified", ItemModifiedPropertyInfo), '("service", ItemServicePropertyInfo)] :: [(Symbol, *)])

itemAttributes :: AttrLabelProxy "attributes"
itemAttributes = AttrLabelProxy

itemCreated :: AttrLabelProxy "created"
itemCreated = AttrLabelProxy

itemLabel :: AttrLabelProxy "label"
itemLabel = AttrLabelProxy

itemLocked :: AttrLabelProxy "locked"
itemLocked = AttrLabelProxy

itemModified :: AttrLabelProxy "modified"
itemModified = AttrLabelProxy

itemService :: AttrLabelProxy "service"
itemService = AttrLabelProxy

type instance O.SignalList Item = ItemSignalList
type ItemSignalList = ('[ '("gPropertiesChanged", Gio.DBusProxy.DBusProxyGPropertiesChangedSignalInfo), '("gSignal", Gio.DBusProxy.DBusProxyGSignalSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method Item::delete
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "secret_item_delete" secret_item_delete :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    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 ()

{- |
Delete this item.

This method returns immediately and completes asynchronously. The secret
service may prompt the user. 'GI.Secret.Objects.Service.servicePrompt' will be used to handle
any prompts that show up.
-}
itemDelete ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: called when the operation completes -}
    -> m ()
itemDelete self cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    secret_item_delete self' maybeCancellable maybeCallback userData
    touchManagedPtr self
    whenJust cancellable touchManagedPtr
    return ()

data ItemDeleteMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemDeleteMethodInfo a signature where
    overloadedMethod _ = itemDelete

-- method Item::delete_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{- |
Complete asynchronous operation to delete the secret item.
-}
itemDeleteFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@self@/: an item -}
    -> b
    {- ^ /@result@/: asynchronous result passed to the callback -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemDeleteFinish self result_ = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ secret_item_delete_finish self' result_'
        touchManagedPtr self
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data ItemDeleteFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemDeleteFinishMethodInfo a signature where
    overloadedMethod _ = itemDeleteFinish

-- method Item::delete_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_delete_sync" secret_item_delete_sync :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Delete this secret item.

This method may block indefinitely and should not be used in user
interface threads. The secret service may prompt the user.
'GI.Secret.Objects.Service.servicePrompt' will be used to handle any prompts that show up.
-}
itemDeleteSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemDeleteSync self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ secret_item_delete_sync self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

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

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

foreign import ccall "secret_item_get_attributes" secret_item_get_attributes :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO (Ptr (GHashTable CString CString))

{- |
Set the attributes of this item.

The /@attributes@/ are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.

Do not modify the attributes returned by this method. Use
'GI.Secret.Objects.Item.itemSetAttributes' instead.
-}
itemGetAttributes ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m (Map.Map T.Text T.Text)
    {- ^ __Returns:__ a new reference
         to the attributes, which should not be modified, and
         released with 'GI.GLib.Functions.hashTableUnref' -}
itemGetAttributes self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_attributes self'
    checkUnexpectedReturnNULL "itemGetAttributes" result
    result' <- unpackGHashTable result
    let result'' = mapFirst cstringUnpackPtr result'
    result''' <- mapFirstA cstringToText result''
    let result'''' = mapSecond cstringUnpackPtr result'''
    result''''' <- mapSecondA cstringToText result''''
    let result'''''' = Map.fromList result'''''
    unrefGHashTable result
    touchManagedPtr self
    return result''''''

data ItemGetAttributesMethodInfo
instance (signature ~ (m (Map.Map T.Text T.Text)), MonadIO m, IsItem a) => O.MethodInfo ItemGetAttributesMethodInfo a signature where
    overloadedMethod _ = itemGetAttributes

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

foreign import ccall "secret_item_get_created" secret_item_get_created :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO Word64

{- |
Get the created date and time of the item. The return value is
the number of seconds since the unix epoch, January 1st 1970.
-}
itemGetCreated ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m Word64
    {- ^ __Returns:__ the created date and time -}
itemGetCreated self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_created self'
    touchManagedPtr self
    return result

data ItemGetCreatedMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsItem a) => O.MethodInfo ItemGetCreatedMethodInfo a signature where
    overloadedMethod _ = itemGetCreated

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

foreign import ccall "secret_item_get_flags" secret_item_get_flags :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO CUInt

{- |
Get the flags representing what features of the 'GI.Secret.Objects.Item.Item' proxy
have been initialized.

Use 'GI.Secret.Objects.Item.itemLoadSecret' to initialize further features
and change the flags.
-}
itemGetFlags ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: the secret item proxy -}
    -> m [Secret.Flags.ItemFlags]
    {- ^ __Returns:__ the flags for features initialized -}
itemGetFlags self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_flags self'
    let result' = wordToGFlags result
    touchManagedPtr self
    return result'

data ItemGetFlagsMethodInfo
instance (signature ~ (m [Secret.Flags.ItemFlags]), MonadIO m, IsItem a) => O.MethodInfo ItemGetFlagsMethodInfo a signature where
    overloadedMethod _ = itemGetFlags

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

foreign import ccall "secret_item_get_label" secret_item_get_label :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO CString

{- |
Get the label of this item.
-}
itemGetLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m T.Text
    {- ^ __Returns:__ the label, which should be freed with 'GI.GLib.Functions.free' -}
itemGetLabel self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_label self'
    checkUnexpectedReturnNULL "itemGetLabel" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

data ItemGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsItem a) => O.MethodInfo ItemGetLabelMethodInfo a signature where
    overloadedMethod _ = itemGetLabel

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

foreign import ccall "secret_item_get_locked" secret_item_get_locked :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO CInt

{- |
Get whether the item is locked or not.

Depending on the secret service an item may not be able to be locked
independently from the collection that it is in.
-}
itemGetLocked ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m Bool
    {- ^ __Returns:__ whether the item is locked or not -}
itemGetLocked self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_locked self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

data ItemGetLockedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsItem a) => O.MethodInfo ItemGetLockedMethodInfo a signature where
    overloadedMethod _ = itemGetLocked

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

foreign import ccall "secret_item_get_modified" secret_item_get_modified :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO Word64

{- |
Get the modified date and time of the item. The return value is
the number of seconds since the unix epoch, January 1st 1970.
-}
itemGetModified ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m Word64
    {- ^ __Returns:__ the modified date and time -}
itemGetModified self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_modified self'
    touchManagedPtr self
    return result

data ItemGetModifiedMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsItem a) => O.MethodInfo ItemGetModifiedMethodInfo a signature where
    overloadedMethod _ = itemGetModified

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

foreign import ccall "secret_item_get_schema_name" secret_item_get_schema_name :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO CString

{- |
Gets the name of the schema that this item was stored with. This is also
available at the \<literal>xdg:schema\<\/literal> attribute.
-}
itemGetSchemaName ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m T.Text
    {- ^ __Returns:__ the schema name -}
itemGetSchemaName self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_schema_name self'
    checkUnexpectedReturnNULL "itemGetSchemaName" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

data ItemGetSchemaNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsItem a) => O.MethodInfo ItemGetSchemaNameMethodInfo a signature where
    overloadedMethod _ = itemGetSchemaName

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

foreign import ccall "secret_item_get_secret" secret_item_get_secret :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO (Ptr Secret.Value.Value)

{- |
Get the secret value of this item. If this item is locked or the secret
has not yet been loaded then this will return 'Nothing'.

To load the secret call the 'GI.Secret.Objects.Item.itemLoadSecret' method.
-}
itemGetSecret ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m (Maybe Secret.Value.Value)
    {- ^ __Returns:__ the secret value which should be
         released with 'GI.Secret.Structs.Value.valueUnref', or 'Nothing' -}
itemGetSecret self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_secret self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Secret.Value.Value) result'
        return result''
    touchManagedPtr self
    return maybeResult

data ItemGetSecretMethodInfo
instance (signature ~ (m (Maybe Secret.Value.Value)), MonadIO m, IsItem a) => O.MethodInfo ItemGetSecretMethodInfo a signature where
    overloadedMethod _ = itemGetSecret

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

foreign import ccall "secret_item_get_service" secret_item_get_service :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO (Ptr Secret.Service.Service)

{- |
Get the Secret Service object that this item was created with.
-}
itemGetService ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: an item -}
    -> m Secret.Service.Service
    {- ^ __Returns:__ the Secret Service object -}
itemGetService self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- secret_item_get_service self'
    checkUnexpectedReturnNULL "itemGetService" result
    result' <- (newObject Secret.Service.Service) result
    touchManagedPtr self
    return result'

data ItemGetServiceMethodInfo
instance (signature ~ (m Secret.Service.Service), MonadIO m, IsItem a) => O.MethodInfo ItemGetServiceMethodInfo a signature where
    overloadedMethod _ = itemGetService

-- method Item::load_secret
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item proxy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "secret_item_load_secret" secret_item_load_secret :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    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 ()

{- |
Load the secret value of this item.

Each item has a single secret which might be a password or some
other secret binary value.

This function will fail if the secret item is locked.

This function returns immediately and completes asynchronously.
-}
itemLoadSecret ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item proxy -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: called when the operation completes -}
    -> m ()
itemLoadSecret self cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    secret_item_load_secret self' maybeCancellable maybeCallback userData
    touchManagedPtr self
    whenJust cancellable touchManagedPtr
    return ()

data ItemLoadSecretMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemLoadSecretMethodInfo a signature where
    overloadedMethod _ = itemLoadSecret

-- method Item::load_secret_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item proxy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{- |
Complete asynchronous operation to load the secret value of this item.

The newly loaded secret value can be accessed by calling
'GI.Secret.Objects.Item.itemGetSecret'.
-}
itemLoadSecretFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@self@/: an item proxy -}
    -> b
    {- ^ /@result@/: asynchronous result passed to callback -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretFinish self result_ = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ secret_item_load_secret_finish self' result_'
        touchManagedPtr self
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data ItemLoadSecretFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemLoadSecretFinishMethodInfo a signature where
    overloadedMethod _ = itemLoadSecretFinish

-- method Item::load_secret_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_load_secret_sync" secret_item_load_secret_sync :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Load the secret value of this item.

Each item has a single secret which might be a password or some
other secret binary value.

This function may block indefinetely. Use the asynchronous version
in user interface threads.
-}
itemLoadSecretSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretSync self cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ secret_item_load_secret_sync self' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

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

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

foreign import ccall "secret_item_refresh" secret_item_refresh :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    IO ()

{- |
Refresh the properties on this item. This fires off a request to
refresh, and the properties will be updated later.

Calling this method is not normally necessary, as the secret service
will notify the client when properties change.
-}
itemRefresh ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a) =>
    a
    {- ^ /@self@/: the collection -}
    -> m ()
itemRefresh self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    secret_item_refresh self'
    touchManagedPtr self
    return ()

data ItemRefreshMethodInfo
instance (signature ~ (m ()), MonadIO m, IsItem a) => O.MethodInfo ItemRefreshMethodInfo a signature where
    overloadedMethod _ = itemRefresh

-- method Item::set_attributes
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new set of attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the asynchronous operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "secret_item_set_attributes" secret_item_set_attributes :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    Ptr Secret.Schema.Schema ->             -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
    Ptr (GHashTable CString CString) ->     -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
    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 ()

{- |
Set the attributes of this item.

The /@attributes@/ are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.

This function returns immediately and completes asynchronously.
-}
itemSetAttributes ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> Maybe (Secret.Schema.Schema)
    {- ^ /@schema@/: the schema for the attributes -}
    -> Map.Map T.Text T.Text
    {- ^ /@attributes@/: a new set of attributes -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: called when the asynchronous operation completes -}
    -> m ()
itemSetAttributes self schema attributes cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeSchema <- case schema of
        Nothing -> return nullPtr
        Just jSchema -> do
            jSchema' <- unsafeManagedPtrGetPtr jSchema
            return jSchema'
    let attributes' = Map.toList attributes
    attributes'' <- mapFirstA textToCString attributes'
    attributes''' <- mapSecondA textToCString attributes''
    let attributes'''' = mapFirst cstringPackPtr attributes'''
    let attributes''''' = mapSecond cstringPackPtr attributes''''
    attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    secret_item_set_attributes self' maybeSchema attributes'''''' maybeCancellable maybeCallback userData
    touchManagedPtr self
    whenJust schema touchManagedPtr
    whenJust cancellable touchManagedPtr
    unrefGHashTable attributes''''''
    return ()

data ItemSetAttributesMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetAttributesMethodInfo a signature where
    overloadedMethod _ = itemSetAttributes

-- method Item::set_attributes_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{- |
Complete operation to set the attributes of this item.
-}
itemSetAttributesFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@self@/: an item -}
    -> b
    {- ^ /@result@/: asynchronous result passed to the callback -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetAttributesFinish self result_ = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ secret_item_set_attributes_finish self' result_'
        touchManagedPtr self
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data ItemSetAttributesFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemSetAttributesFinishMethodInfo a signature where
    overloadedMethod _ = itemSetAttributesFinish

-- method Item::set_attributes_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new set of attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_set_attributes_sync" secret_item_set_attributes_sync :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    Ptr Secret.Schema.Schema ->             -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
    Ptr (GHashTable CString CString) ->     -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Set the attributes of this item.

The /@attributes@/ are a mapping of string keys to string values.
Attributes are used to search for items. Attributes are not stored
or transferred securely by the secret service.

This function may block indefinetely. Use the asynchronous version
in user interface threads.
-}
itemSetAttributesSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> Maybe (Secret.Schema.Schema)
    {- ^ /@schema@/: the schema for the attributes -}
    -> Map.Map T.Text T.Text
    {- ^ /@attributes@/: a new set of attributes -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetAttributesSync self schema attributes cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeSchema <- case schema of
        Nothing -> return nullPtr
        Just jSchema -> do
            jSchema' <- unsafeManagedPtrGetPtr jSchema
            return jSchema'
    let attributes' = Map.toList attributes
    attributes'' <- mapFirstA textToCString attributes'
    attributes''' <- mapSecondA textToCString attributes''
    let attributes'''' = mapFirst cstringPackPtr attributes'''
    let attributes''''' = mapSecond cstringPackPtr attributes''''
    attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ secret_item_set_attributes_sync self' maybeSchema attributes'''''' maybeCancellable
        touchManagedPtr self
        whenJust schema touchManagedPtr
        whenJust cancellable touchManagedPtr
        unrefGHashTable attributes''''''
        return ()
     ) (do
        unrefGHashTable attributes''''''
     )

data ItemSetAttributesSyncMethodInfo
instance (signature ~ (Maybe (Secret.Schema.Schema) -> Map.Map T.Text T.Text -> Maybe (b) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetAttributesSyncMethodInfo a signature where
    overloadedMethod _ = itemSetAttributesSync

-- method Item::set_label
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new label", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "secret_item_set_label" secret_item_set_label :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    CString ->                              -- label : TBasicType TUTF8
    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 ()

{- |
Set the label of this item.

This function returns immediately and completes asynchronously.
-}
itemSetLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> T.Text
    {- ^ /@label@/: a new label -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: called when the operation completes -}
    -> m ()
itemSetLabel self label cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    label' <- textToCString label
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    secret_item_set_label self' label' maybeCancellable maybeCallback userData
    touchManagedPtr self
    whenJust cancellable touchManagedPtr
    freeMem label'
    return ()

data ItemSetLabelMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetLabelMethodInfo a signature where
    overloadedMethod _ = itemSetLabel

-- method Item::set_label_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{- |
Complete asynchronous operation to set the label of this collection.
-}
itemSetLabelFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@self@/: an item -}
    -> b
    {- ^ /@result@/: asynchronous result passed to callback -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetLabelFinish self result_ = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ secret_item_set_label_finish self' result_'
        touchManagedPtr self
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data ItemSetLabelFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemSetLabelFinishMethodInfo a signature where
    overloadedMethod _ = itemSetLabelFinish

-- method Item::set_label_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new label", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_set_label_sync" secret_item_set_label_sync :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    CString ->                              -- label : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Set the label of this item.

This function may block indefinetely. Use the asynchronous version
in user interface threads.
-}
itemSetLabelSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> T.Text
    {- ^ /@label@/: a new label -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetLabelSync self label cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    label' <- textToCString label
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ secret_item_set_label_sync self' label' maybeCancellable
        touchManagedPtr self
        whenJust cancellable touchManagedPtr
        freeMem label'
        return ()
     ) (do
        freeMem label'
     )

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

-- method Item::set_secret
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new secret value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 4, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "secret_item_set_secret" secret_item_set_secret :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    Ptr Secret.Value.Value ->               -- value : TInterface (Name {namespace = "Secret", name = "Value"})
    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 ()

{- |
Set the secret value of this item.

Each item has a single secret which might be a password or some
other secret binary value.

This function returns immediately and completes asynchronously.
-}
itemSetSecret ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> Secret.Value.Value
    {- ^ /@value@/: a new secret value -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: called when the operation completes -}
    -> m ()
itemSetSecret self value cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    value' <- unsafeManagedPtrGetPtr value
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    secret_item_set_secret self' value' maybeCancellable maybeCallback userData
    touchManagedPtr self
    touchManagedPtr value
    whenJust cancellable touchManagedPtr
    return ()

data ItemSetSecretMethodInfo
instance (signature ~ (Secret.Value.Value -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetSecretMethodInfo a signature where
    overloadedMethod _ = itemSetSecret

-- method Item::set_secret_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{- |
Complete asynchronous operation to set the secret value of this item.
-}
itemSetSecretFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@self@/: an item -}
    -> b
    {- ^ /@result@/: asynchronous result passed to callback -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetSecretFinish self result_ = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ secret_item_set_secret_finish self' result_'
        touchManagedPtr self
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data ItemSetSecretFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsItem a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo ItemSetSecretFinishMethodInfo a signature where
    overloadedMethod _ = itemSetSecretFinish

-- method Item::set_secret_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Secret", name = "Item"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a new secret value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_set_secret_sync" secret_item_set_secret_sync :: 
    Ptr Item ->                             -- self : TInterface (Name {namespace = "Secret", name = "Item"})
    Ptr Secret.Value.Value ->               -- value : TInterface (Name {namespace = "Secret", name = "Value"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Set the secret value of this item.

Each item has a single secret which might be a password or some
other secret binary value.

This function may block indefinetely. Use the asynchronous version
in user interface threads.
-}
itemSetSecretSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@self@/: an item -}
    -> Secret.Value.Value
    {- ^ /@value@/: a new secret value -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemSetSecretSync self value cancellable = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    value' <- unsafeManagedPtrGetPtr value
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ secret_item_set_secret_sync self' value' maybeCancellable
        touchManagedPtr self
        touchManagedPtr value
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

data ItemSetSecretSyncMethodInfo
instance (signature ~ (Secret.Value.Value -> Maybe (b) -> m ()), MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) => O.MethodInfo ItemSetSecretSyncMethodInfo a signature where
    overloadedMethod _ = itemSetSecretSync

-- method Item::create
-- method type : MemberFunction
-- Args : [Arg {argCName = "collection", argType = TInterface (Name {namespace = "Secret", name = "Collection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a secret collection to create this item in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "attributes for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "label for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "secret value for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for the creation of the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 8, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "secret_item_create" secret_item_create :: 
    Ptr Secret.Collection.Collection ->     -- collection : TInterface (Name {namespace = "Secret", name = "Collection"})
    Ptr Secret.Schema.Schema ->             -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
    Ptr (GHashTable CString CString) ->     -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
    CString ->                              -- label : TBasicType TUTF8
    Ptr Secret.Value.Value ->               -- value : TInterface (Name {namespace = "Secret", name = "Value"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"})
    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 ()

{- |
Create a new item in the secret service.

If the /@flags@/ contains 'GI.Secret.Flags.ItemCreateFlagsReplace', then the secret
service will search for an item matching the /@attributes@/, and update that item
instead of creating a new one.

This method may block indefinitely and should not be used in user interface
threads. The secret service may prompt the user. 'GI.Secret.Objects.Service.servicePrompt'
will be used to handle any prompts that are required.
-}
itemCreate ::
    (B.CallStack.HasCallStack, MonadIO m, Secret.Collection.IsCollection a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@collection@/: a secret collection to create this item in -}
    -> Maybe (Secret.Schema.Schema)
    {- ^ /@schema@/: the schema for the attributes -}
    -> Map.Map T.Text T.Text
    {- ^ /@attributes@/: attributes for the new item -}
    -> T.Text
    {- ^ /@label@/: label for the new item -}
    -> Secret.Value.Value
    {- ^ /@value@/: secret value for the new item -}
    -> [Secret.Flags.ItemCreateFlags]
    {- ^ /@flags@/: flags for the creation of the new item -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: called when the operation completes -}
    -> m ()
itemCreate collection schema attributes label value flags cancellable callback = liftIO $ do
    collection' <- unsafeManagedPtrCastPtr collection
    maybeSchema <- case schema of
        Nothing -> return nullPtr
        Just jSchema -> do
            jSchema' <- unsafeManagedPtrGetPtr jSchema
            return jSchema'
    let attributes' = Map.toList attributes
    attributes'' <- mapFirstA textToCString attributes'
    attributes''' <- mapSecondA textToCString attributes''
    let attributes'''' = mapFirst cstringPackPtr attributes'''
    let attributes''''' = mapSecond cstringPackPtr attributes''''
    attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
    label' <- textToCString label
    value' <- unsafeManagedPtrGetPtr value
    let flags' = gflagsToWord flags
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    secret_item_create collection' maybeSchema attributes'''''' label' value' flags' maybeCancellable maybeCallback userData
    touchManagedPtr collection
    whenJust schema touchManagedPtr
    touchManagedPtr value
    whenJust cancellable touchManagedPtr
    unrefGHashTable attributes''''''
    freeMem label'
    return ()

-- method Item::create_finish
-- method type : MemberFunction
-- Args : [Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the asynchronous result passed to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "Item"}))
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_create_finish" secret_item_create_finish :: 
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Item)

{- |
Finish operation to create a new item in the secret service.
-}
itemCreateFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
    a
    {- ^ /@result@/: the asynchronous result passed to the callback -}
    -> m Item
    {- ^ __Returns:__ the new item, which should be unreferenced
         with 'GI.GObject.Objects.Object.objectUnref' /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemCreateFinish result_ = liftIO $ do
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        result <- propagateGError $ secret_item_create_finish result_'
        checkUnexpectedReturnNULL "itemCreateFinish" result
        result' <- (wrapObject Item) result
        touchManagedPtr result_
        return result'
     ) (do
        return ()
     )

-- method Item::create_sync
-- method type : MemberFunction
-- Args : [Arg {argCName = "collection", argType = TInterface (Name {namespace = "Secret", name = "Collection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a secret collection to create this item in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "schema", argType = TInterface (Name {namespace = "Secret", name = "Schema"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the schema for the attributes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attributes", argType = TGHash (TBasicType TUTF8) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "attributes for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "label for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "Secret", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "secret value for the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags for the creation of the new item", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Secret", name = "Item"}))
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_create_sync" secret_item_create_sync :: 
    Ptr Secret.Collection.Collection ->     -- collection : TInterface (Name {namespace = "Secret", name = "Collection"})
    Ptr Secret.Schema.Schema ->             -- schema : TInterface (Name {namespace = "Secret", name = "Schema"})
    Ptr (GHashTable CString CString) ->     -- attributes : TGHash (TBasicType TUTF8) (TBasicType TUTF8)
    CString ->                              -- label : TBasicType TUTF8
    Ptr Secret.Value.Value ->               -- value : TInterface (Name {namespace = "Secret", name = "Value"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Secret", name = "ItemCreateFlags"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Item)

{- |
Create a new item in the secret service.

If the /@flags@/ contains 'GI.Secret.Flags.ItemCreateFlagsReplace', then the secret
service will search for an item matching the /@attributes@/, and update that item
instead of creating a new one.

This method may block indefinitely and should not be used in user interface
threads. The secret service may prompt the user. 'GI.Secret.Objects.Service.servicePrompt'
will be used to handle any prompts that are required.
-}
itemCreateSync ::
    (B.CallStack.HasCallStack, MonadIO m, Secret.Collection.IsCollection a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@collection@/: a secret collection to create this item in -}
    -> Maybe (Secret.Schema.Schema)
    {- ^ /@schema@/: the schema for the attributes -}
    -> Map.Map T.Text T.Text
    {- ^ /@attributes@/: attributes for the new item -}
    -> T.Text
    {- ^ /@label@/: label for the new item -}
    -> Secret.Value.Value
    {- ^ /@value@/: secret value for the new item -}
    -> [Secret.Flags.ItemCreateFlags]
    {- ^ /@flags@/: flags for the creation of the new item -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> m Item
    {- ^ __Returns:__ the new item, which should be unreferenced
         with 'GI.GObject.Objects.Object.objectUnref' /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemCreateSync collection schema attributes label value flags cancellable = liftIO $ do
    collection' <- unsafeManagedPtrCastPtr collection
    maybeSchema <- case schema of
        Nothing -> return nullPtr
        Just jSchema -> do
            jSchema' <- unsafeManagedPtrGetPtr jSchema
            return jSchema'
    let attributes' = Map.toList attributes
    attributes'' <- mapFirstA textToCString attributes'
    attributes''' <- mapSecondA textToCString attributes''
    let attributes'''' = mapFirst cstringPackPtr attributes'''
    let attributes''''' = mapSecond cstringPackPtr attributes''''
    attributes'''''' <- packGHashTable gStrHash gStrEqual (Just ptr_to_g_free) (Just ptr_to_g_free) attributes'''''
    label' <- textToCString label
    value' <- unsafeManagedPtrGetPtr value
    let flags' = gflagsToWord flags
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ secret_item_create_sync collection' maybeSchema attributes'''''' label' value' flags' maybeCancellable
        checkUnexpectedReturnNULL "itemCreateSync" result
        result' <- (wrapObject Item) result
        touchManagedPtr collection
        whenJust schema touchManagedPtr
        touchManagedPtr value
        whenJust cancellable touchManagedPtr
        unrefGHashTable attributes''''''
        freeMem label'
        return result'
     ) (do
        unrefGHashTable attributes''''''
        freeMem label'
     )

-- method Item::load_secrets
-- method type : MemberFunction
-- Args : [Arg {argCName = "items", argType = TGList (TInterface (Name {namespace = "Secret", name = "Item"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items to retrieve secrets for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "called when the operation completes", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to the callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "secret_item_load_secrets" secret_item_load_secrets :: 
    Ptr (GList (Ptr Item)) ->               -- items : TGList (TInterface (Name {namespace = "Secret", name = "Item"}))
    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 ()

{- |
Load the secret values for an secret items stored in the service.

The /@items@/ must all have the same SecretItem::service property.

This function returns immediately and completes asynchronously.
-}
itemLoadSecrets ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    [a]
    {- ^ /@items@/: the items to retrieve secrets for -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: called when the operation completes -}
    -> m ()
itemLoadSecrets items cancellable callback = liftIO $ do
    items' <- mapM unsafeManagedPtrCastPtr items
    items'' <- packGList items'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    secret_item_load_secrets items'' maybeCancellable maybeCallback userData
    mapM_ touchManagedPtr items
    whenJust cancellable touchManagedPtr
    g_list_free items''
    return ()

-- method Item::load_secrets_finish
-- method type : MemberFunction
-- Args : [Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "asynchronous result passed to callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{- |
Complete asynchronous operation to load the secret values for
secret items stored in the service.

Items that are locked will not have their secrets loaded.
-}
itemLoadSecretsFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
    a
    {- ^ /@result@/: asynchronous result passed to callback -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretsFinish result_ = liftIO $ do
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ secret_item_load_secrets_finish result_'
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

-- method Item::load_secrets_sync
-- method type : MemberFunction
-- Args : [Arg {argCName = "items", argType = TGList (TInterface (Name {namespace = "Secret", name = "Item"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the items to retrieve secrets for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional cancellation object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "secret_item_load_secrets_sync" secret_item_load_secrets_sync :: 
    Ptr (GList (Ptr Item)) ->               -- items : TGList (TInterface (Name {namespace = "Secret", name = "Item"}))
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Load the secret values for an secret items stored in the service.

The /@items@/ must all have the same SecretItem::service property.

This method may block indefinitely and should not be used in user interface
threads.

Items that are locked will not have their secrets loaded.
-}
itemLoadSecretsSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsItem a, Gio.Cancellable.IsCancellable b) =>
    [a]
    {- ^ /@items@/: the items to retrieve secrets for -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional cancellation object -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
itemLoadSecretsSync items cancellable = liftIO $ do
    items' <- mapM unsafeManagedPtrCastPtr items
    items'' <- packGList items'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ secret_item_load_secrets_sync items'' maybeCancellable
        mapM_ touchManagedPtr items
        whenJust cancellable touchManagedPtr
        g_list_free items''
        return ()
     ) (do
        g_list_free items''
     )