{-# LANGUAGE TypeApplications #-}


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

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

module GI.NM.Objects.SecretAgentOld
    ( 

-- * Exported types
    SecretAgentOld(..)                      ,
    IsSecretAgentOld                        ,
    toSecretAgentOld                        ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [deleteSecrets]("GI.NM.Objects.SecretAgentOld#g:method:deleteSecrets"), [destroy]("GI.NM.Objects.SecretAgentOld#g:method:destroy"), [enable]("GI.NM.Objects.SecretAgentOld#g:method:enable"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [init]("GI.Gio.Interfaces.Initable#g:method:init"), [initAsync]("GI.Gio.Interfaces.AsyncInitable#g:method:initAsync"), [initFinish]("GI.Gio.Interfaces.AsyncInitable#g:method:initFinish"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [newFinish]("GI.Gio.Interfaces.AsyncInitable#g:method:newFinish"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [register]("GI.NM.Objects.SecretAgentOld#g:method:register"), [registerAsync]("GI.NM.Objects.SecretAgentOld#g:method:registerAsync"), [registerFinish]("GI.NM.Objects.SecretAgentOld#g:method:registerFinish"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [saveSecrets]("GI.NM.Objects.SecretAgentOld#g:method:saveSecrets"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [unregister]("GI.NM.Objects.SecretAgentOld#g:method:unregister"), [unregisterAsync]("GI.NM.Objects.SecretAgentOld#g:method:unregisterAsync"), [unregisterFinish]("GI.NM.Objects.SecretAgentOld#g:method:unregisterFinish"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getContextBusyWatcher]("GI.NM.Objects.SecretAgentOld#g:method:getContextBusyWatcher"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDbusConnection]("GI.NM.Objects.SecretAgentOld#g:method:getDbusConnection"), [getDbusNameOwner]("GI.NM.Objects.SecretAgentOld#g:method:getDbusNameOwner"), [getMainContext]("GI.NM.Objects.SecretAgentOld#g:method:getMainContext"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getRegistered]("GI.NM.Objects.SecretAgentOld#g:method:getRegistered"), [getSecrets]("GI.NM.Objects.SecretAgentOld#g:method:getSecrets").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveSecretAgentOldMethod             ,
#endif

-- ** deleteSecrets #method:deleteSecrets#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldDeleteSecretsMethodInfo   ,
#endif
    secretAgentOldDeleteSecrets             ,


-- ** destroy #method:destroy#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldDestroyMethodInfo         ,
#endif
    secretAgentOldDestroy                   ,


-- ** enable #method:enable#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldEnableMethodInfo          ,
#endif
    secretAgentOldEnable                    ,


-- ** getContextBusyWatcher #method:getContextBusyWatcher#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldGetContextBusyWatcherMethodInfo,
#endif
    secretAgentOldGetContextBusyWatcher     ,


-- ** getDbusConnection #method:getDbusConnection#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldGetDbusConnectionMethodInfo,
#endif
    secretAgentOldGetDbusConnection         ,


-- ** getDbusNameOwner #method:getDbusNameOwner#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldGetDbusNameOwnerMethodInfo,
#endif
    secretAgentOldGetDbusNameOwner          ,


-- ** getMainContext #method:getMainContext#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldGetMainContextMethodInfo  ,
#endif
    secretAgentOldGetMainContext            ,


-- ** getRegistered #method:getRegistered#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldGetRegisteredMethodInfo   ,
#endif
    secretAgentOldGetRegistered             ,


-- ** getSecrets #method:getSecrets#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldGetSecretsMethodInfo      ,
#endif
    secretAgentOldGetSecrets                ,


-- ** register #method:register#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldRegisterMethodInfo        ,
#endif
    secretAgentOldRegister                  ,


-- ** registerAsync #method:registerAsync#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldRegisterAsyncMethodInfo   ,
#endif
    secretAgentOldRegisterAsync             ,


-- ** registerFinish #method:registerFinish#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldRegisterFinishMethodInfo  ,
#endif
    secretAgentOldRegisterFinish            ,


-- ** saveSecrets #method:saveSecrets#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldSaveSecretsMethodInfo     ,
#endif
    secretAgentOldSaveSecrets               ,


-- ** unregister #method:unregister#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldUnregisterMethodInfo      ,
#endif
    secretAgentOldUnregister                ,


-- ** unregisterAsync #method:unregisterAsync#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldUnregisterAsyncMethodInfo ,
#endif
    secretAgentOldUnregisterAsync           ,


-- ** unregisterFinish #method:unregisterFinish#

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldUnregisterFinishMethodInfo,
#endif
    secretAgentOldUnregisterFinish          ,




 -- * Properties


-- ** autoRegister #attr:autoRegister#
-- | If 'P.True' (the default), the agent will always be registered when
-- NetworkManager is running; if NetworkManager exits and restarts, the
-- agent will re-register itself automatically.
-- 
-- In particular, if this property is 'P.True' at construct time, then the
-- agent will register itself with NetworkManager during
-- construction\/initialization and initialization will only complete
-- after registration is completed (either successfully or unsuccessfully).
-- Since 1.24, a failure to register will no longer cause initialization
-- of t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' to fail.
-- 
-- If the property is 'P.False', the agent will not automatically register with
-- NetworkManager, and 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable' or
-- 'GI.NM.Objects.SecretAgentOld.secretAgentOldRegisterAsync' must be called to register it.
-- 
-- Calling 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable' has the same effect as setting this
-- property.

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldAutoRegisterPropertyInfo  ,
#endif
    constructSecretAgentOldAutoRegister     ,
    getSecretAgentOldAutoRegister           ,
#if defined(ENABLE_OVERLOADING)
    secretAgentOldAutoRegister              ,
#endif
    setSecretAgentOldAutoRegister           ,


-- ** capabilities #attr:capabilities#
-- | A bitfield of @/NMSecretAgentCapabilities/@.
-- 
-- Changing this property is possible at any time. In case the secret
-- agent is currently registered, this will cause a re-registration.

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldCapabilitiesPropertyInfo  ,
#endif
    constructSecretAgentOldCapabilities     ,
    getSecretAgentOldCapabilities           ,
#if defined(ENABLE_OVERLOADING)
    secretAgentOldCapabilities              ,
#endif
    setSecretAgentOldCapabilities           ,


-- ** dbusConnection #attr:dbusConnection#
-- | The t'GI.Gio.Objects.DBusConnection.DBusConnection' used by the instance. You may either set this
-- as construct-only property, or otherwise t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' will choose
-- a connection via 'GI.Gio.Functions.busGet' during initialization.
-- 
-- /Since: 1.24/

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldDbusConnectionPropertyInfo,
#endif
    constructSecretAgentOldDbusConnection   ,
    getSecretAgentOldDbusConnection         ,
#if defined(ENABLE_OVERLOADING)
    secretAgentOldDbusConnection            ,
#endif


-- ** identifier #attr:identifier#
-- | Identifies this agent; only one agent in each user session may use the
-- same identifier.  Identifier formatting follows the same rules as
-- D-Bus bus names with the exception that the \':\' character is not
-- allowed.  The valid set of characters is \"[A-Z][a-z][0-9]_-.\" and the
-- identifier is limited in length to 255 characters with a minimum
-- of 3 characters.  An example valid identifier is \'org.gnome.nm-applet\'
-- (without quotes).

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldIdentifierPropertyInfo    ,
#endif
    constructSecretAgentOldIdentifier       ,
    getSecretAgentOldIdentifier             ,
#if defined(ENABLE_OVERLOADING)
    secretAgentOldIdentifier                ,
#endif


-- ** registered #attr:registered#
-- | 'P.True' if the agent is registered with NetworkManager, 'P.False' if not.

#if defined(ENABLE_OVERLOADING)
    SecretAgentOldRegisteredPropertyInfo    ,
#endif
    getSecretAgentOldRegistered             ,
#if defined(ENABLE_OVERLOADING)
    secretAgentOldRegistered                ,
#endif




    ) where

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

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

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
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.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import qualified GI.NM.Callbacks as NM.Callbacks
import {-# SOURCE #-} qualified GI.NM.Enums as NM.Enums
import {-# SOURCE #-} qualified GI.NM.Flags as NM.Flags
import {-# SOURCE #-} qualified GI.NM.Interfaces.Connection as NM.Connection
import {-# SOURCE #-} qualified GI.NM.Objects.Setting as NM.Setting
import {-# SOURCE #-} qualified GI.NM.Objects.Setting8021x as NM.Setting8021x
import {-# SOURCE #-} qualified GI.NM.Objects.SettingAdsl as NM.SettingAdsl
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBluetooth as NM.SettingBluetooth
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBond as NM.SettingBond
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridge as NM.SettingBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridgePort as NM.SettingBridgePort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingCdma as NM.SettingCdma
import {-# SOURCE #-} qualified GI.NM.Objects.SettingConnection as NM.SettingConnection
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDcb as NM.SettingDcb
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDummy as NM.SettingDummy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGeneric as NM.SettingGeneric
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGsm as NM.SettingGsm
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP4Config as NM.SettingIP4Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP6Config as NM.SettingIP6Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPConfig as NM.SettingIPConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPTunnel as NM.SettingIPTunnel
import {-# SOURCE #-} qualified GI.NM.Objects.SettingInfiniband as NM.SettingInfiniband
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacsec as NM.SettingMacsec
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacvlan as NM.SettingMacvlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOlpcMesh as NM.SettingOlpcMesh
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsBridge as NM.SettingOvsBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsInterface as NM.SettingOvsInterface
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPatch as NM.SettingOvsPatch
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPort as NM.SettingOvsPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPpp as NM.SettingPpp
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPppoe as NM.SettingPppoe
import {-# SOURCE #-} qualified GI.NM.Objects.SettingProxy as NM.SettingProxy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingSerial as NM.SettingSerial
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTCConfig as NM.SettingTCConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeam as NM.SettingTeam
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeamPort as NM.SettingTeamPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTun as NM.SettingTun
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVlan as NM.SettingVlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVpn as NM.SettingVpn
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVxlan as NM.SettingVxlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWimax as NM.SettingWimax
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWired as NM.SettingWired
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWireless as NM.SettingWireless
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWirelessSecurity as NM.SettingWirelessSecurity
import {-# SOURCE #-} qualified GI.NM.Structs.BridgeVlan as NM.BridgeVlan
import {-# SOURCE #-} qualified GI.NM.Structs.IPAddress as NM.IPAddress
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoute as NM.IPRoute
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoutingRule as NM.IPRoutingRule
import {-# SOURCE #-} qualified GI.NM.Structs.Range as NM.Range
import {-# SOURCE #-} qualified GI.NM.Structs.TCAction as NM.TCAction
import {-# SOURCE #-} qualified GI.NM.Structs.TCQdisc as NM.TCQdisc
import {-# SOURCE #-} qualified GI.NM.Structs.TCTfilter as NM.TCTfilter
import {-# SOURCE #-} qualified GI.NM.Structs.TeamLinkWatcher as NM.TeamLinkWatcher
import {-# SOURCE #-} qualified GI.NM.Structs.VariantAttributeSpec as NM.VariantAttributeSpec

#else
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
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.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import qualified GI.NM.Callbacks as NM.Callbacks
import {-# SOURCE #-} qualified GI.NM.Flags as NM.Flags
import {-# SOURCE #-} qualified GI.NM.Interfaces.Connection as NM.Connection

#endif

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

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

foreign import ccall "nm_secret_agent_old_get_type"
    c_nm_secret_agent_old_get_type :: IO B.Types.GType

instance B.Types.TypedObject SecretAgentOld where
    glibType :: IO GType
glibType = IO GType
c_nm_secret_agent_old_get_type

instance B.Types.GObject SecretAgentOld

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

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

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveSecretAgentOldMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSecretAgentOldMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSecretAgentOldMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSecretAgentOldMethod "deleteSecrets" o = SecretAgentOldDeleteSecretsMethodInfo
    ResolveSecretAgentOldMethod "destroy" o = SecretAgentOldDestroyMethodInfo
    ResolveSecretAgentOldMethod "enable" o = SecretAgentOldEnableMethodInfo
    ResolveSecretAgentOldMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSecretAgentOldMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSecretAgentOldMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSecretAgentOldMethod "init" o = Gio.Initable.InitableInitMethodInfo
    ResolveSecretAgentOldMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
    ResolveSecretAgentOldMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
    ResolveSecretAgentOldMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSecretAgentOldMethod "newFinish" o = Gio.AsyncInitable.AsyncInitableNewFinishMethodInfo
    ResolveSecretAgentOldMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSecretAgentOldMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSecretAgentOldMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSecretAgentOldMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSecretAgentOldMethod "register" o = SecretAgentOldRegisterMethodInfo
    ResolveSecretAgentOldMethod "registerAsync" o = SecretAgentOldRegisterAsyncMethodInfo
    ResolveSecretAgentOldMethod "registerFinish" o = SecretAgentOldRegisterFinishMethodInfo
    ResolveSecretAgentOldMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSecretAgentOldMethod "saveSecrets" o = SecretAgentOldSaveSecretsMethodInfo
    ResolveSecretAgentOldMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSecretAgentOldMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSecretAgentOldMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSecretAgentOldMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSecretAgentOldMethod "unregister" o = SecretAgentOldUnregisterMethodInfo
    ResolveSecretAgentOldMethod "unregisterAsync" o = SecretAgentOldUnregisterAsyncMethodInfo
    ResolveSecretAgentOldMethod "unregisterFinish" o = SecretAgentOldUnregisterFinishMethodInfo
    ResolveSecretAgentOldMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSecretAgentOldMethod "getContextBusyWatcher" o = SecretAgentOldGetContextBusyWatcherMethodInfo
    ResolveSecretAgentOldMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSecretAgentOldMethod "getDbusConnection" o = SecretAgentOldGetDbusConnectionMethodInfo
    ResolveSecretAgentOldMethod "getDbusNameOwner" o = SecretAgentOldGetDbusNameOwnerMethodInfo
    ResolveSecretAgentOldMethod "getMainContext" o = SecretAgentOldGetMainContextMethodInfo
    ResolveSecretAgentOldMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSecretAgentOldMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSecretAgentOldMethod "getRegistered" o = SecretAgentOldGetRegisteredMethodInfo
    ResolveSecretAgentOldMethod "getSecrets" o = SecretAgentOldGetSecretsMethodInfo
    ResolveSecretAgentOldMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSecretAgentOldMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSecretAgentOldMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSecretAgentOldMethod l o = O.MethodResolutionFailed l o

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

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

#endif

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

#endif

-- VVV Prop "auto-register"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@auto-register@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' secretAgentOld #autoRegister
-- @
getSecretAgentOldAutoRegister :: (MonadIO m, IsSecretAgentOld o) => o -> m Bool
getSecretAgentOldAutoRegister :: forall (m :: * -> *) o.
(MonadIO m, IsSecretAgentOld o) =>
o -> m Bool
getSecretAgentOldAutoRegister o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"auto-register"

-- | Set the value of the “@auto-register@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' secretAgentOld [ #autoRegister 'Data.GI.Base.Attributes.:=' value ]
-- @
setSecretAgentOldAutoRegister :: (MonadIO m, IsSecretAgentOld o) => o -> Bool -> m ()
setSecretAgentOldAutoRegister :: forall (m :: * -> *) o.
(MonadIO m, IsSecretAgentOld o) =>
o -> Bool -> m ()
setSecretAgentOldAutoRegister o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"auto-register" Bool
val

-- | Construct a t'GValueConstruct' with valid value for the “@auto-register@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSecretAgentOldAutoRegister :: (IsSecretAgentOld o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSecretAgentOldAutoRegister :: forall o (m :: * -> *).
(IsSecretAgentOld o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSecretAgentOldAutoRegister Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"auto-register" Bool
val

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldAutoRegisterPropertyInfo
instance AttrInfo SecretAgentOldAutoRegisterPropertyInfo where
    type AttrAllowedOps SecretAgentOldAutoRegisterPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SecretAgentOldAutoRegisterPropertyInfo = IsSecretAgentOld
    type AttrSetTypeConstraint SecretAgentOldAutoRegisterPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint SecretAgentOldAutoRegisterPropertyInfo = (~) Bool
    type AttrTransferType SecretAgentOldAutoRegisterPropertyInfo = Bool
    type AttrGetType SecretAgentOldAutoRegisterPropertyInfo = Bool
    type AttrLabel SecretAgentOldAutoRegisterPropertyInfo = "auto-register"
    type AttrOrigin SecretAgentOldAutoRegisterPropertyInfo = SecretAgentOld
    attrGet = getSecretAgentOldAutoRegister
    attrSet = setSecretAgentOldAutoRegister
    attrTransfer _ v = do
        return v
    attrConstruct = constructSecretAgentOldAutoRegister
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.autoRegister"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#g:attr:autoRegister"
        })
#endif

-- VVV Prop "capabilities"
   -- Type: TInterface (Name {namespace = "NM", name = "SecretAgentCapabilities"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@capabilities@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' secretAgentOld #capabilities
-- @
getSecretAgentOldCapabilities :: (MonadIO m, IsSecretAgentOld o) => o -> m [NM.Flags.SecretAgentCapabilities]
getSecretAgentOldCapabilities :: forall (m :: * -> *) o.
(MonadIO m, IsSecretAgentOld o) =>
o -> m [SecretAgentCapabilities]
getSecretAgentOldCapabilities o
obj = IO [SecretAgentCapabilities] -> m [SecretAgentCapabilities]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO [SecretAgentCapabilities] -> m [SecretAgentCapabilities])
-> IO [SecretAgentCapabilities] -> m [SecretAgentCapabilities]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [SecretAgentCapabilities]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"capabilities"

-- | Set the value of the “@capabilities@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' secretAgentOld [ #capabilities 'Data.GI.Base.Attributes.:=' value ]
-- @
setSecretAgentOldCapabilities :: (MonadIO m, IsSecretAgentOld o) => o -> [NM.Flags.SecretAgentCapabilities] -> m ()
setSecretAgentOldCapabilities :: forall (m :: * -> *) o.
(MonadIO m, IsSecretAgentOld o) =>
o -> [SecretAgentCapabilities] -> m ()
setSecretAgentOldCapabilities o
obj [SecretAgentCapabilities]
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> [SecretAgentCapabilities] -> IO ()
forall a b.
(IsGFlag b, BoxedFlags b, GObject a) =>
a -> String -> [b] -> IO ()
B.Properties.setObjectPropertyFlags o
obj String
"capabilities" [SecretAgentCapabilities]
val

-- | Construct a t'GValueConstruct' with valid value for the “@capabilities@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSecretAgentOldCapabilities :: (IsSecretAgentOld o, MIO.MonadIO m) => [NM.Flags.SecretAgentCapabilities] -> m (GValueConstruct o)
constructSecretAgentOldCapabilities :: forall o (m :: * -> *).
(IsSecretAgentOld o, MonadIO m) =>
[SecretAgentCapabilities] -> m (GValueConstruct o)
constructSecretAgentOldCapabilities [SecretAgentCapabilities]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> [SecretAgentCapabilities] -> IO (GValueConstruct o)
forall a o.
(IsGFlag a, BoxedFlags a) =>
String -> [a] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyFlags String
"capabilities" [SecretAgentCapabilities]
val

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldCapabilitiesPropertyInfo
instance AttrInfo SecretAgentOldCapabilitiesPropertyInfo where
    type AttrAllowedOps SecretAgentOldCapabilitiesPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SecretAgentOldCapabilitiesPropertyInfo = IsSecretAgentOld
    type AttrSetTypeConstraint SecretAgentOldCapabilitiesPropertyInfo = (~) [NM.Flags.SecretAgentCapabilities]
    type AttrTransferTypeConstraint SecretAgentOldCapabilitiesPropertyInfo = (~) [NM.Flags.SecretAgentCapabilities]
    type AttrTransferType SecretAgentOldCapabilitiesPropertyInfo = [NM.Flags.SecretAgentCapabilities]
    type AttrGetType SecretAgentOldCapabilitiesPropertyInfo = [NM.Flags.SecretAgentCapabilities]
    type AttrLabel SecretAgentOldCapabilitiesPropertyInfo = "capabilities"
    type AttrOrigin SecretAgentOldCapabilitiesPropertyInfo = SecretAgentOld
    attrGet = getSecretAgentOldCapabilities
    attrSet = setSecretAgentOldCapabilities
    attrTransfer _ v = do
        return v
    attrConstruct = constructSecretAgentOldCapabilities
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.capabilities"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#g:attr:capabilities"
        })
#endif

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

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

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

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldDbusConnectionPropertyInfo
instance AttrInfo SecretAgentOldDbusConnectionPropertyInfo where
    type AttrAllowedOps SecretAgentOldDbusConnectionPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SecretAgentOldDbusConnectionPropertyInfo = IsSecretAgentOld
    type AttrSetTypeConstraint SecretAgentOldDbusConnectionPropertyInfo = Gio.DBusConnection.IsDBusConnection
    type AttrTransferTypeConstraint SecretAgentOldDbusConnectionPropertyInfo = Gio.DBusConnection.IsDBusConnection
    type AttrTransferType SecretAgentOldDbusConnectionPropertyInfo = Gio.DBusConnection.DBusConnection
    type AttrGetType SecretAgentOldDbusConnectionPropertyInfo = Gio.DBusConnection.DBusConnection
    type AttrLabel SecretAgentOldDbusConnectionPropertyInfo = "dbus-connection"
    type AttrOrigin SecretAgentOldDbusConnectionPropertyInfo = SecretAgentOld
    attrGet = getSecretAgentOldDbusConnection
    attrSet = undefined
    attrTransfer _ v = do
        unsafeCastTo Gio.DBusConnection.DBusConnection v
    attrConstruct = constructSecretAgentOldDbusConnection
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.dbusConnection"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#g:attr:dbusConnection"
        })
#endif

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

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

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

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldIdentifierPropertyInfo
instance AttrInfo SecretAgentOldIdentifierPropertyInfo where
    type AttrAllowedOps SecretAgentOldIdentifierPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SecretAgentOldIdentifierPropertyInfo = IsSecretAgentOld
    type AttrSetTypeConstraint SecretAgentOldIdentifierPropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint SecretAgentOldIdentifierPropertyInfo = (~) T.Text
    type AttrTransferType SecretAgentOldIdentifierPropertyInfo = T.Text
    type AttrGetType SecretAgentOldIdentifierPropertyInfo = (Maybe T.Text)
    type AttrLabel SecretAgentOldIdentifierPropertyInfo = "identifier"
    type AttrOrigin SecretAgentOldIdentifierPropertyInfo = SecretAgentOld
    attrGet = getSecretAgentOldIdentifier
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructSecretAgentOldIdentifier
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.identifier"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#g:attr:identifier"
        })
#endif

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

-- | Get the value of the “@registered@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' secretAgentOld #registered
-- @
getSecretAgentOldRegistered :: (MonadIO m, IsSecretAgentOld o) => o -> m Bool
getSecretAgentOldRegistered :: forall (m :: * -> *) o.
(MonadIO m, IsSecretAgentOld o) =>
o -> m Bool
getSecretAgentOldRegistered o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"registered"

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldRegisteredPropertyInfo
instance AttrInfo SecretAgentOldRegisteredPropertyInfo where
    type AttrAllowedOps SecretAgentOldRegisteredPropertyInfo = '[ 'AttrGet]
    type AttrBaseTypeConstraint SecretAgentOldRegisteredPropertyInfo = IsSecretAgentOld
    type AttrSetTypeConstraint SecretAgentOldRegisteredPropertyInfo = (~) ()
    type AttrTransferTypeConstraint SecretAgentOldRegisteredPropertyInfo = (~) ()
    type AttrTransferType SecretAgentOldRegisteredPropertyInfo = ()
    type AttrGetType SecretAgentOldRegisteredPropertyInfo = Bool
    type AttrLabel SecretAgentOldRegisteredPropertyInfo = "registered"
    type AttrOrigin SecretAgentOldRegisteredPropertyInfo = SecretAgentOld
    attrGet = getSecretAgentOldRegistered
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.registered"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#g:attr:registered"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SecretAgentOld
type instance O.AttributeList SecretAgentOld = SecretAgentOldAttributeList
type SecretAgentOldAttributeList = ('[ '("autoRegister", SecretAgentOldAutoRegisterPropertyInfo), '("capabilities", SecretAgentOldCapabilitiesPropertyInfo), '("dbusConnection", SecretAgentOldDbusConnectionPropertyInfo), '("identifier", SecretAgentOldIdentifierPropertyInfo), '("registered", SecretAgentOldRegisteredPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
secretAgentOldAutoRegister :: AttrLabelProxy "autoRegister"
secretAgentOldAutoRegister = AttrLabelProxy

secretAgentOldCapabilities :: AttrLabelProxy "capabilities"
secretAgentOldCapabilities = AttrLabelProxy

secretAgentOldDbusConnection :: AttrLabelProxy "dbusConnection"
secretAgentOldDbusConnection = AttrLabelProxy

secretAgentOldIdentifier :: AttrLabelProxy "identifier"
secretAgentOldIdentifier = AttrLabelProxy

secretAgentOldRegistered :: AttrLabelProxy "registered"
secretAgentOldRegistered = AttrLabelProxy

#endif

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

#endif

-- method SecretAgentOld::delete_secrets
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "connection"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "Connection" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMConnection" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "NM" , name = "SecretAgentOldDeleteSecretsFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a callback, to be invoked when the operation is done"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "caller-specific data to be passed to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_delete_secrets" nm_secret_agent_old_delete_secrets :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    Ptr NM.Connection.Connection ->         -- connection : TInterface (Name {namespace = "NM", name = "Connection"})
    FunPtr NM.Callbacks.C_SecretAgentOldDeleteSecretsFunc -> -- callback : TInterface (Name {namespace = "NM", name = "SecretAgentOldDeleteSecretsFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Asynchronously asks the agent to delete all saved secrets belonging to
-- /@connection@/.
secretAgentOldDeleteSecrets ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, NM.Connection.IsConnection b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> b
    -- ^ /@connection@/: a t'GI.NM.Interfaces.Connection.Connection'
    -> NM.Callbacks.SecretAgentOldDeleteSecretsFunc
    -- ^ /@callback@/: a callback, to be invoked when the operation is done
    -> m ()
secretAgentOldDeleteSecrets :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsConnection b) =>
a -> b -> SecretAgentOldDeleteSecretsFunc -> m ()
secretAgentOldDeleteSecrets a
self b
connection SecretAgentOldDeleteSecretsFunc
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Connection
connection' <- b -> IO (Ptr Connection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
connection
    Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
ptrcallback <- IO (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr NM.Callbacks.C_SecretAgentOldDeleteSecretsFunc))
    FunPtr C_SecretAgentOldDeleteSecretsFunc
callback' <- C_SecretAgentOldDeleteSecretsFunc
-> IO (FunPtr C_SecretAgentOldDeleteSecretsFunc)
NM.Callbacks.mk_SecretAgentOldDeleteSecretsFunc (Maybe (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc))
-> SecretAgentOldDeleteSecretsFunc_WithClosures
-> C_SecretAgentOldDeleteSecretsFunc
NM.Callbacks.wrap_SecretAgentOldDeleteSecretsFunc (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
-> Maybe (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
ptrcallback) (SecretAgentOldDeleteSecretsFunc
-> SecretAgentOldDeleteSecretsFunc_WithClosures
NM.Callbacks.drop_closures_SecretAgentOldDeleteSecretsFunc SecretAgentOldDeleteSecretsFunc
callback))
    Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
-> FunPtr C_SecretAgentOldDeleteSecretsFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
ptrcallback FunPtr C_SecretAgentOldDeleteSecretsFunc
callback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr SecretAgentOld
-> Ptr Connection
-> FunPtr C_SecretAgentOldDeleteSecretsFunc
-> Ptr ()
-> IO ()
nm_secret_agent_old_delete_secrets Ptr SecretAgentOld
self' Ptr Connection
connection' FunPtr C_SecretAgentOldDeleteSecretsFunc
callback' Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
connection
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldDeleteSecretsMethodInfo
instance (signature ~ (b -> NM.Callbacks.SecretAgentOldDeleteSecretsFunc -> m ()), MonadIO m, IsSecretAgentOld a, NM.Connection.IsConnection b) => O.OverloadedMethod SecretAgentOldDeleteSecretsMethodInfo a signature where
    overloadedMethod = secretAgentOldDeleteSecrets

instance O.OverloadedMethodInfo SecretAgentOldDeleteSecretsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldDeleteSecrets",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldDeleteSecrets"
        })


#endif

-- method SecretAgentOld::destroy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSecretAgentOld instance."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_destroy" nm_secret_agent_old_destroy :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    IO ()

-- | Since 1.24, the instance will already register a D-Bus object on the
-- D-Bus connection during initialization. That object will stay registered
-- until /@self@/ gets unrefed (destroyed) or this function is called. This
-- function performs the necessary cleanup to tear down the instance. Afterwards,
-- the function can not longer be used. This is optional, but necessary to
-- ensure unregistering the D-Bus object at a define point, when other users
-- might still have a reference on /@self@/.
-- 
-- You may call this function any time and repeatedly. However, after destroying
-- the instance, it is a bug to still use the instance for other purposes. The
-- instance becomes defunct and cannot re-register.
-- 
-- /Since: 1.24/
secretAgentOldDestroy ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a) =>
    a
    -- ^ /@self@/: the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' instance.
    -> m ()
secretAgentOldDestroy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSecretAgentOld a) =>
a -> m ()
secretAgentOldDestroy a
self = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr SecretAgentOld -> IO ()
nm_secret_agent_old_destroy Ptr SecretAgentOld
self'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldDestroyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSecretAgentOld a) => O.OverloadedMethod SecretAgentOldDestroyMethodInfo a signature where
    overloadedMethod = secretAgentOldDestroy

instance O.OverloadedMethodInfo SecretAgentOldDestroyMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldDestroy",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldDestroy"
        })


#endif

-- method SecretAgentOld::enable
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSecretAgentOld instance"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "enable"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "whether to enable or disable the listener."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_enable" nm_secret_agent_old_enable :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    CInt ->                                 -- enable : TBasicType TBoolean
    IO ()

-- | This has the same effect as setting 'GI.NM.Constants.SECRET_AGENT_OLD_AUTO_REGISTER'
-- property.
-- 
-- Unlike most other functions, you may already call this function before
-- initialization completes.
-- 
-- /Since: 1.24/
secretAgentOldEnable ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a) =>
    a
    -- ^ /@self@/: the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' instance
    -> Bool
    -- ^ /@enable@/: whether to enable or disable the listener.
    -> m ()
secretAgentOldEnable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSecretAgentOld a) =>
a -> Bool -> m ()
secretAgentOldEnable a
self Bool
enable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let enable' :: CInt
enable' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
enable
    Ptr SecretAgentOld -> CInt -> IO ()
nm_secret_agent_old_enable Ptr SecretAgentOld
self' CInt
enable'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldEnableMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsSecretAgentOld a) => O.OverloadedMethod SecretAgentOldEnableMethodInfo a signature where
    overloadedMethod = secretAgentOldEnable

instance O.OverloadedMethodInfo SecretAgentOldEnableMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldEnable",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldEnable"
        })


#endif

-- method SecretAgentOld::get_context_busy_watcher
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSecretAgentOld instance"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GObject" , name = "Object" })
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_get_context_busy_watcher" nm_secret_agent_old_get_context_busy_watcher :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    IO (Ptr GObject.Object.Object)

-- | Returns a t'GI.GObject.Objects.Object.Object' that stays alive as long as there are pending
-- requests in the t'GI.Gio.Objects.DBusConnection.DBusConnection'. Such requests keep the t'GI.GLib.Structs.MainContext.MainContext'
-- alive, and thus you may want to keep iterating the context as long
-- until a weak reference indicates that this object is gone. This is
-- useful because even when you destroy the instance right away (and all
-- the internally pending requests get cancelled), any pending 'GI.Gio.Objects.DBusConnection.dBusConnectionCall'
-- requests will still invoke the result on the t'GI.GLib.Structs.MainContext.MainContext'. Hence, this
-- allows you to know how long you must iterate the context to know
-- that all remains are cleaned up.
-- 
-- /Since: 1.24/
secretAgentOldGetContextBusyWatcher ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a) =>
    a
    -- ^ /@self@/: the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' instance
    -> m GObject.Object.Object
    -- ^ __Returns:__ a t'GI.GObject.Objects.Object.Object' that you may register a weak pointer
    --   to know that the t'GI.GLib.Structs.MainContext.MainContext' is still kept busy by /@self@/.
secretAgentOldGetContextBusyWatcher :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSecretAgentOld a) =>
a -> m Object
secretAgentOldGetContextBusyWatcher a
self = IO Object -> m Object
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Object -> m Object) -> IO Object -> m Object
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Object
result <- Ptr SecretAgentOld -> IO (Ptr Object)
nm_secret_agent_old_get_context_busy_watcher Ptr SecretAgentOld
self'
    Text -> Ptr Object -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"secretAgentOldGetContextBusyWatcher" Ptr Object
result
    Object
result' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Object -> IO Object
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result'

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldGetContextBusyWatcherMethodInfo
instance (signature ~ (m GObject.Object.Object), MonadIO m, IsSecretAgentOld a) => O.OverloadedMethod SecretAgentOldGetContextBusyWatcherMethodInfo a signature where
    overloadedMethod = secretAgentOldGetContextBusyWatcher

instance O.OverloadedMethodInfo SecretAgentOldGetContextBusyWatcherMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldGetContextBusyWatcher",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldGetContextBusyWatcher"
        })


#endif

-- method SecretAgentOld::get_dbus_connection
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSecretAgentOld instance"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gio" , name = "DBusConnection" })
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_get_dbus_connection" nm_secret_agent_old_get_dbus_connection :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    IO (Ptr Gio.DBusConnection.DBusConnection)

-- | /No description available in the introspection data./
-- 
-- /Since: 1.24/
secretAgentOldGetDbusConnection ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a) =>
    a
    -- ^ /@self@/: the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' instance
    -> m Gio.DBusConnection.DBusConnection
    -- ^ __Returns:__ the t'GI.Gio.Objects.DBusConnection.DBusConnection' used by the secret agent.
    --   You may either set this as construct property 'GI.NM.Constants.SECRET_AGENT_OLD_DBUS_CONNECTION',
    --   or it will automatically set during initialization.
secretAgentOldGetDbusConnection :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSecretAgentOld a) =>
a -> m DBusConnection
secretAgentOldGetDbusConnection a
self = IO DBusConnection -> m DBusConnection
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusConnection -> m DBusConnection)
-> IO DBusConnection -> m DBusConnection
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr DBusConnection
result <- Ptr SecretAgentOld -> IO (Ptr DBusConnection)
nm_secret_agent_old_get_dbus_connection Ptr SecretAgentOld
self'
    Text -> Ptr DBusConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"secretAgentOldGetDbusConnection" Ptr DBusConnection
result
    DBusConnection
result' <- ((ManagedPtr DBusConnection -> DBusConnection)
-> Ptr DBusConnection -> IO DBusConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DBusConnection -> DBusConnection
Gio.DBusConnection.DBusConnection) Ptr DBusConnection
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    DBusConnection -> IO DBusConnection
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return DBusConnection
result'

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldGetDbusConnectionMethodInfo
instance (signature ~ (m Gio.DBusConnection.DBusConnection), MonadIO m, IsSecretAgentOld a) => O.OverloadedMethod SecretAgentOldGetDbusConnectionMethodInfo a signature where
    overloadedMethod = secretAgentOldGetDbusConnection

instance O.OverloadedMethodInfo SecretAgentOldGetDbusConnectionMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldGetDbusConnection",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldGetDbusConnection"
        })


#endif

-- method SecretAgentOld::get_dbus_name_owner
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSecretAgentOld instance"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_get_dbus_name_owner" nm_secret_agent_old_get_dbus_name_owner :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    IO CString

-- | /No description available in the introspection data./
-- 
-- /Since: 1.24/
secretAgentOldGetDbusNameOwner ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a) =>
    a
    -- ^ /@self@/: the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' instance
    -> m T.Text
    -- ^ __Returns:__ the current D-Bus name owner. While this property
    --   is set while registering, it really only makes sense when
    --   the 'GI.NM.Objects.SecretAgentOld.secretAgentOldGetRegistered' indicates that
    --   registration is successful.
secretAgentOldGetDbusNameOwner :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSecretAgentOld a) =>
a -> m Text
secretAgentOldGetDbusNameOwner a
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CString
result <- Ptr SecretAgentOld -> IO CString
nm_secret_agent_old_get_dbus_name_owner Ptr SecretAgentOld
self'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"secretAgentOldGetDbusNameOwner" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldGetDbusNameOwnerMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSecretAgentOld a) => O.OverloadedMethod SecretAgentOldGetDbusNameOwnerMethodInfo a signature where
    overloadedMethod = secretAgentOldGetDbusNameOwner

instance O.OverloadedMethodInfo SecretAgentOldGetDbusNameOwnerMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldGetDbusNameOwner",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldGetDbusNameOwner"
        })


#endif

-- method SecretAgentOld::get_main_context
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSecretAgentOld instance"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GLib" , name = "MainContext" })
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_get_main_context" nm_secret_agent_old_get_main_context :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    IO (Ptr GLib.MainContext.MainContext)

-- | /No description available in the introspection data./
-- 
-- /Since: 1.24/
secretAgentOldGetMainContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a) =>
    a
    -- ^ /@self@/: the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' instance
    -> m GLib.MainContext.MainContext
    -- ^ __Returns:__ the t'GI.GLib.Structs.MainContext.MainContext' instance associate with the
    --   instance. This is the 'GI.GLib.Functions.mainContextGetThreadDefault' at the time
    --   when creating the instance.
secretAgentOldGetMainContext :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSecretAgentOld a) =>
a -> m MainContext
secretAgentOldGetMainContext a
self = IO MainContext -> m MainContext
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MainContext -> m MainContext)
-> IO MainContext -> m MainContext
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr MainContext
result <- Ptr SecretAgentOld -> IO (Ptr MainContext)
nm_secret_agent_old_get_main_context Ptr SecretAgentOld
self'
    Text -> Ptr MainContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"secretAgentOldGetMainContext" Ptr MainContext
result
    MainContext
result' <- ((ManagedPtr MainContext -> MainContext)
-> Ptr MainContext -> IO MainContext
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr MainContext -> MainContext
GLib.MainContext.MainContext) Ptr MainContext
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    MainContext -> IO MainContext
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return MainContext
result'

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldGetMainContextMethodInfo
instance (signature ~ (m GLib.MainContext.MainContext), MonadIO m, IsSecretAgentOld a) => O.OverloadedMethod SecretAgentOldGetMainContextMethodInfo a signature where
    overloadedMethod = secretAgentOldGetMainContext

instance O.OverloadedMethodInfo SecretAgentOldGetMainContextMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldGetMainContext",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldGetMainContext"
        })


#endif

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

foreign import ccall "nm_secret_agent_old_get_registered" nm_secret_agent_old_get_registered :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    IO CInt

-- | Note that the secret agent transparently registers and re-registers
-- as the D-Bus name owner appears. Hence, this property is not really
-- useful. Also, to be graceful against races during registration, the
-- instance will already accept requests while being in the process of
-- registering.
-- If you need to avoid races and want to wait until /@self@/ is registered,
-- call 'GI.NM.Objects.SecretAgentOld.secretAgentOldRegisterAsync'. If that function completes
-- with success, you know the instance is registered.
secretAgentOldGetRegistered ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> m Bool
    -- ^ __Returns:__ a 'P.True' if the agent is registered, 'P.False' if it is not.
secretAgentOldGetRegistered :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSecretAgentOld a) =>
a -> m Bool
secretAgentOldGetRegistered a
self = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    CInt
result <- Ptr SecretAgentOld -> IO CInt
nm_secret_agent_old_get_registered Ptr SecretAgentOld
self'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldGetRegisteredMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSecretAgentOld a) => O.OverloadedMethod SecretAgentOldGetRegisteredMethodInfo a signature where
    overloadedMethod = secretAgentOldGetRegistered

instance O.OverloadedMethodInfo SecretAgentOldGetRegisteredMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldGetRegistered",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldGetRegistered"
        })


#endif

-- method SecretAgentOld::get_secrets
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "connection"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "Connection" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #NMConnection for which we're asked secrets"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "setting_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the secret setting"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hints"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "hints to the agent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "NM" , name = "SecretAgentGetSecretsFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "flags that modify the behavior of the request"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface
--                 Name { namespace = "NM" , name = "SecretAgentOldGetSecretsFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a callback, to be invoked when the operation is done"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 6
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "caller-specific data to be passed to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_get_secrets" nm_secret_agent_old_get_secrets :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    Ptr NM.Connection.Connection ->         -- connection : TInterface (Name {namespace = "NM", name = "Connection"})
    CString ->                              -- setting_name : TBasicType TUTF8
    Ptr CString ->                          -- hints : TCArray True (-1) (-1) (TBasicType TUTF8)
    CUInt ->                                -- flags : TInterface (Name {namespace = "NM", name = "SecretAgentGetSecretsFlags"})
    FunPtr NM.Callbacks.C_SecretAgentOldGetSecretsFunc -> -- callback : TInterface (Name {namespace = "NM", name = "SecretAgentOldGetSecretsFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Asynchronously retrieves secrets belonging to /@connection@/ for the
-- setting /@settingName@/.  /@flags@/ indicate specific behavior that the secret
-- agent should use when performing the request, for example returning only
-- existing secrets without user interaction, or requesting entirely new
-- secrets from the user.
secretAgentOldGetSecrets ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, NM.Connection.IsConnection b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> b
    -- ^ /@connection@/: the t'GI.NM.Interfaces.Connection.Connection' for which we\'re asked secrets
    -> T.Text
    -- ^ /@settingName@/: the name of the secret setting
    -> [T.Text]
    -- ^ /@hints@/: hints to the agent
    -> [NM.Flags.SecretAgentGetSecretsFlags]
    -- ^ /@flags@/: flags that modify the behavior of the request
    -> NM.Callbacks.SecretAgentOldGetSecretsFunc
    -- ^ /@callback@/: a callback, to be invoked when the operation is done
    -> m ()
secretAgentOldGetSecrets :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsConnection b) =>
a
-> b
-> Text
-> [Text]
-> [SecretAgentGetSecretsFlags]
-> SecretAgentOldGetSecretsFunc
-> m ()
secretAgentOldGetSecrets a
self b
connection Text
settingName [Text]
hints [SecretAgentGetSecretsFlags]
flags SecretAgentOldGetSecretsFunc
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Connection
connection' <- b -> IO (Ptr Connection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
connection
    CString
settingName' <- Text -> IO CString
textToCString Text
settingName
    Ptr CString
hints' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
hints
    let flags' :: CUInt
flags' = [SecretAgentGetSecretsFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SecretAgentGetSecretsFlags]
flags
    Ptr (FunPtr C_SecretAgentOldGetSecretsFunc)
ptrcallback <- IO (Ptr (FunPtr C_SecretAgentOldGetSecretsFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr NM.Callbacks.C_SecretAgentOldGetSecretsFunc))
    FunPtr C_SecretAgentOldGetSecretsFunc
callback' <- C_SecretAgentOldGetSecretsFunc
-> IO (FunPtr C_SecretAgentOldGetSecretsFunc)
NM.Callbacks.mk_SecretAgentOldGetSecretsFunc (Maybe (Ptr (FunPtr C_SecretAgentOldGetSecretsFunc))
-> SecretAgentOldGetSecretsFunc_WithClosures
-> C_SecretAgentOldGetSecretsFunc
NM.Callbacks.wrap_SecretAgentOldGetSecretsFunc (Ptr (FunPtr C_SecretAgentOldGetSecretsFunc)
-> Maybe (Ptr (FunPtr C_SecretAgentOldGetSecretsFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_SecretAgentOldGetSecretsFunc)
ptrcallback) (SecretAgentOldGetSecretsFunc
-> SecretAgentOldGetSecretsFunc_WithClosures
NM.Callbacks.drop_closures_SecretAgentOldGetSecretsFunc SecretAgentOldGetSecretsFunc
callback))
    Ptr (FunPtr C_SecretAgentOldGetSecretsFunc)
-> FunPtr C_SecretAgentOldGetSecretsFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_SecretAgentOldGetSecretsFunc)
ptrcallback FunPtr C_SecretAgentOldGetSecretsFunc
callback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr SecretAgentOld
-> Ptr Connection
-> CString
-> Ptr CString
-> CUInt
-> FunPtr C_SecretAgentOldGetSecretsFunc
-> Ptr ()
-> IO ()
nm_secret_agent_old_get_secrets Ptr SecretAgentOld
self' Ptr Connection
connection' CString
settingName' Ptr CString
hints' CUInt
flags' FunPtr C_SecretAgentOldGetSecretsFunc
callback' Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
connection
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
settingName'
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
hints'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
hints'
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldGetSecretsMethodInfo
instance (signature ~ (b -> T.Text -> [T.Text] -> [NM.Flags.SecretAgentGetSecretsFlags] -> NM.Callbacks.SecretAgentOldGetSecretsFunc -> m ()), MonadIO m, IsSecretAgentOld a, NM.Connection.IsConnection b) => O.OverloadedMethod SecretAgentOldGetSecretsMethodInfo a signature where
    overloadedMethod = secretAgentOldGetSecrets

instance O.OverloadedMethodInfo SecretAgentOldGetSecretsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldGetSecrets",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldGetSecrets"
        })


#endif

-- method SecretAgentOld::register
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{-# DEPRECATED secretAgentOldRegister ["(Since version 1.24)","Use 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable' or 'GI.NM.Objects.SecretAgentOld.secretAgentOldRegisterAsync'."] #-}
-- | Registers the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' with the NetworkManager secret manager,
-- indicating to NetworkManager that the agent is able to provide and save
-- secrets for connections on behalf of its user.
secretAgentOldRegister ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
secretAgentOldRegister :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsCancellable b) =>
a -> Maybe b -> m ()
secretAgentOldRegister a
self Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr SecretAgentOld
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
nm_secret_agent_old_register Ptr SecretAgentOld
self' Ptr Cancellable
maybeCancellable
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

instance O.OverloadedMethodInfo SecretAgentOldRegisterMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldRegister",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldRegister"
        })


#endif

-- method SecretAgentOld::register_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback to call when the agent is registered"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data for @callback" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_register_async" nm_secret_agent_old_register_async :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Asynchronously registers the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' with the NetworkManager secret
-- manager, indicating to NetworkManager that the agent is able to provide and
-- save secrets for connections on behalf of its user.
-- 
-- Since 1.24, registration cannot fail and is idempotent. It has
-- the same effect as setting 'GI.NM.Constants.SECRET_AGENT_OLD_AUTO_REGISTER' to 'P.True'
-- or 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable'.
-- 
-- Since 1.24, the asynchronous result indicates whether the instance is successfully
-- registered. In any case, this call enables the agent and it will automatically
-- try to register and handle secret requests. A failure of this function only indicates
-- that currently the instance might not be ready (but since it will automatically
-- try to recover, it might be ready in a moment afterwards). Use this function if
-- you want to check and ensure that the agent is registered.
secretAgentOldRegisterAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: callback to call when the agent is registered
    -> m ()
secretAgentOldRegisterAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
secretAgentOldRegisterAsync a
self Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr SecretAgentOld
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
nm_secret_agent_old_register_async Ptr SecretAgentOld
self' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldRegisterAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSecretAgentOld a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SecretAgentOldRegisterAsyncMethodInfo a signature where
    overloadedMethod = secretAgentOldRegisterAsync

instance O.OverloadedMethodInfo SecretAgentOldRegisterAsyncMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldRegisterAsync",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldRegisterAsync"
        })


#endif

-- method SecretAgentOld::register_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the result passed to the #GAsyncReadyCallback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

-- | Gets the result of a call to 'GI.NM.Objects.SecretAgentOld.secretAgentOldRegisterAsync'.
secretAgentOldRegisterFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> b
    -- ^ /@result@/: the result passed to the t'GI.Gio.Callbacks.AsyncReadyCallback'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
secretAgentOldRegisterFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsAsyncResult b) =>
a -> b -> m ()
secretAgentOldRegisterFinish a
self b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr SecretAgentOld
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
nm_secret_agent_old_register_finish Ptr SecretAgentOld
self' Ptr AsyncResult
result_'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

instance O.OverloadedMethodInfo SecretAgentOldRegisterFinishMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldRegisterFinish",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldRegisterFinish"
        })


#endif

-- method SecretAgentOld::save_secrets
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "connection"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "Connection" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMConnection" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface
--                 Name { namespace = "NM" , name = "SecretAgentOldSaveSecretsFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a callback, to be invoked when the operation is done"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "caller-specific data to be passed to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_secret_agent_old_save_secrets" nm_secret_agent_old_save_secrets :: 
    Ptr SecretAgentOld ->                   -- self : TInterface (Name {namespace = "NM", name = "SecretAgentOld"})
    Ptr NM.Connection.Connection ->         -- connection : TInterface (Name {namespace = "NM", name = "Connection"})
    FunPtr NM.Callbacks.C_SecretAgentOldSaveSecretsFunc -> -- callback : TInterface (Name {namespace = "NM", name = "SecretAgentOldSaveSecretsFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Asynchronously ensures that all secrets inside /@connection@/ are stored to
-- disk.
secretAgentOldSaveSecrets ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, NM.Connection.IsConnection b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> b
    -- ^ /@connection@/: a t'GI.NM.Interfaces.Connection.Connection'
    -> NM.Callbacks.SecretAgentOldSaveSecretsFunc
    -- ^ /@callback@/: a callback, to be invoked when the operation is done
    -> m ()
secretAgentOldSaveSecrets :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsConnection b) =>
a -> b -> SecretAgentOldDeleteSecretsFunc -> m ()
secretAgentOldSaveSecrets a
self b
connection SecretAgentOldDeleteSecretsFunc
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Connection
connection' <- b -> IO (Ptr Connection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
connection
    Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
ptrcallback <- IO (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr NM.Callbacks.C_SecretAgentOldSaveSecretsFunc))
    FunPtr C_SecretAgentOldDeleteSecretsFunc
callback' <- C_SecretAgentOldDeleteSecretsFunc
-> IO (FunPtr C_SecretAgentOldDeleteSecretsFunc)
NM.Callbacks.mk_SecretAgentOldSaveSecretsFunc (Maybe (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc))
-> SecretAgentOldDeleteSecretsFunc_WithClosures
-> C_SecretAgentOldDeleteSecretsFunc
NM.Callbacks.wrap_SecretAgentOldSaveSecretsFunc (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
-> Maybe (Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
ptrcallback) (SecretAgentOldDeleteSecretsFunc
-> SecretAgentOldDeleteSecretsFunc_WithClosures
NM.Callbacks.drop_closures_SecretAgentOldSaveSecretsFunc SecretAgentOldDeleteSecretsFunc
callback))
    Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
-> FunPtr C_SecretAgentOldDeleteSecretsFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_SecretAgentOldDeleteSecretsFunc)
ptrcallback FunPtr C_SecretAgentOldDeleteSecretsFunc
callback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr SecretAgentOld
-> Ptr Connection
-> FunPtr C_SecretAgentOldDeleteSecretsFunc
-> Ptr ()
-> IO ()
nm_secret_agent_old_save_secrets Ptr SecretAgentOld
self' Ptr Connection
connection' FunPtr C_SecretAgentOldDeleteSecretsFunc
callback' Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
connection
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldSaveSecretsMethodInfo
instance (signature ~ (b -> NM.Callbacks.SecretAgentOldSaveSecretsFunc -> m ()), MonadIO m, IsSecretAgentOld a, NM.Connection.IsConnection b) => O.OverloadedMethod SecretAgentOldSaveSecretsMethodInfo a signature where
    overloadedMethod = secretAgentOldSaveSecrets

instance O.OverloadedMethodInfo SecretAgentOldSaveSecretsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldSaveSecrets",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldSaveSecrets"
        })


#endif

-- method SecretAgentOld::unregister
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{-# DEPRECATED secretAgentOldUnregister ["(Since version 1.24)","Use 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable'."] #-}
-- | Unregisters the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' with the NetworkManager secret manager,
-- indicating to NetworkManager that the agent will no longer provide or
-- store secrets on behalf of this user.
secretAgentOldUnregister ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
secretAgentOldUnregister :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsCancellable b) =>
a -> Maybe b -> m ()
secretAgentOldUnregister a
self Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr SecretAgentOld
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
nm_secret_agent_old_unregister Ptr SecretAgentOld
self' Ptr Cancellable
maybeCancellable
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

instance O.OverloadedMethodInfo SecretAgentOldUnregisterMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldUnregister",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldUnregister"
        })


#endif

-- method SecretAgentOld::unregister_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "callback to call when the agent is unregistered"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data for @callback" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

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

{-# DEPRECATED secretAgentOldUnregisterAsync ["(Since version 1.24)","Use 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable'."] #-}
-- | Asynchronously unregisters the t'GI.NM.Objects.SecretAgentOld.SecretAgentOld' with the NetworkManager secret
-- manager, indicating to NetworkManager that the agent will no longer provide
-- or store secrets on behalf of this user.
-- 
-- Since 1.24, registration cannot fail and is idempotent. It has
-- the same effect as setting 'GI.NM.Constants.SECRET_AGENT_OLD_AUTO_REGISTER' to 'P.False'
-- or 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable'.
secretAgentOldUnregisterAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: callback to call when the agent is unregistered
    -> m ()
secretAgentOldUnregisterAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
secretAgentOldUnregisterAsync a
self Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr SecretAgentOld
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
nm_secret_agent_old_unregister_async Ptr SecretAgentOld
self' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SecretAgentOldUnregisterAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSecretAgentOld a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SecretAgentOldUnregisterAsyncMethodInfo a signature where
    overloadedMethod = secretAgentOldUnregisterAsync

instance O.OverloadedMethodInfo SecretAgentOldUnregisterAsyncMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldUnregisterAsync",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldUnregisterAsync"
        })


#endif

-- method SecretAgentOld::unregister_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SecretAgentOld" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMSecretAgentOld"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the result passed to the #GAsyncReadyCallback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

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

{-# DEPRECATED secretAgentOldUnregisterFinish ["(Since version 1.24)","Use 'GI.NM.Objects.SecretAgentOld.secretAgentOldEnable'."] #-}
-- | Gets the result of a call to 'GI.NM.Objects.SecretAgentOld.secretAgentOldUnregisterAsync'.
secretAgentOldUnregisterFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsSecretAgentOld a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: a t'GI.NM.Objects.SecretAgentOld.SecretAgentOld'
    -> b
    -- ^ /@result@/: the result passed to the t'GI.Gio.Callbacks.AsyncReadyCallback'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
secretAgentOldUnregisterFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSecretAgentOld a, IsAsyncResult b) =>
a -> b -> m ()
secretAgentOldUnregisterFinish a
self b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SecretAgentOld
self' <- a -> IO (Ptr SecretAgentOld)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr SecretAgentOld
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
nm_secret_agent_old_unregister_finish Ptr SecretAgentOld
self' Ptr AsyncResult
result_'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

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

instance O.OverloadedMethodInfo SecretAgentOldUnregisterFinishMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SecretAgentOld.secretAgentOldUnregisterFinish",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SecretAgentOld.html#v:secretAgentOldUnregisterFinish"
        })


#endif