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

'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' is used to create, monitor and delete object
proxies for remote objects exported by a 'GI.Gio.Objects.DBusObjectManagerServer.DBusObjectManagerServer' (or any
code implementing the
<http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager org.freedesktop.DBus.ObjectManager>
interface).

Once an instance of this type has been created, you can connect to
the 'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-added/@ and
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-removed/@ signals and inspect the
'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' objects returned by
'GI.Gio.Interfaces.DBusObjectManager.dBusObjectManagerGetObjects'.

If the name for a 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' is not owned by anyone at
object construction time, the default behavior is to request the
message bus to launch an owner for the name. This behavior can be
disabled using the 'GI.Gio.Flags.DBusObjectManagerClientFlagsDoNotAutoStart'
flag. It\'s also worth noting that this only works if the name of
interest is activatable in the first place. E.g. in some cases it
is not possible to launch an owner for the requested name. In this
case, 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object construction still succeeds but
there will be no object proxies
(e.g. 'GI.Gio.Interfaces.DBusObjectManager.dBusObjectManagerGetObjects' returns the empty list) and
the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ property is 'Nothing'.

The owner of the requested name can come and go (for example
consider a system service being restarted) – 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'
handles this case too; simply connect to the 'GI.GObject.Objects.Object.Object'::@/notify/@
signal to watch for changes on the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@
property. When the name owner vanishes, the behavior is that
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ is set to 'Nothing' (this includes
emission of the 'GI.GObject.Objects.Object.Object'::@/notify/@ signal) and then
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-removed/@ signals are synthesized
for all currently existing object proxies. Since
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ is 'Nothing' when this happens, you can
use this information to disambiguate a synthesized signal from a
genuine signal caused by object removal on the remote
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'. Similarly, when a new name owner appears,
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/object-added/@ signals are synthesized
while 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ is still 'Nothing'. Only when all
object proxies have been added, the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@
is set to the new name owner (this includes emission of the
'GI.GObject.Objects.Object.Object'::@/notify/@ signal).  Furthermore, you are guaranteed that
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ will alternate between a name owner
(e.g. @:1.42@) and 'Nothing' even in the case where
the name of interest is atomically replaced

Ultimately, 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' is used to obtain 'GI.Gio.Objects.DBusProxy.DBusProxy'
instances. All signals (including the
org.freedesktop.DBus.Properties::PropertiesChanged signal)
delivered to 'GI.Gio.Objects.DBusProxy.DBusProxy' instances are guaranteed to originate
from the name owner. This guarantee along with the behavior
described above, means that certain race conditions including the
\"half the proxy is from the old owner and the other half is from
the new owner\" problem cannot happen.

To avoid having the application connect to signals on the returned
'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' and 'GI.Gio.Objects.DBusProxy.DBusProxy' objects, the
'GI.Gio.Interfaces.DBusObject.DBusObject'::@/interface-added/@,
'GI.Gio.Interfaces.DBusObject.DBusObject'::@/interface-removed/@,
'GI.Gio.Objects.DBusProxy.DBusProxy'::@/g-properties-changed/@ and
'GI.Gio.Objects.DBusProxy.DBusProxy'::@/g-signal/@ signals
are also emitted on the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' instance managing these
objects. The signals emitted are
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/interface-added/@,
'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'::@/interface-removed/@,
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'::@/interface-proxy-properties-changed/@ and
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'::@/interface-proxy-signal/@.

Note that all callbacks and signals are emitted in the
[thread-default main context][g-main-context-push-thread-default]
that the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object was constructed
in. Additionally, the 'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' and 'GI.Gio.Objects.DBusProxy.DBusProxy' objects
originating from the 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object will be created in
the same context and, consequently, will deliver signals in the
same main loop.
-}

module GI.Gio.Objects.DBusObjectManagerClient
    ( 

-- * Exported types
    DBusObjectManagerClient(..)             ,
    IsDBusObjectManagerClient               ,
    toDBusObjectManagerClient               ,
    noDBusObjectManagerClient               ,


 -- * Methods
-- ** getConnection #method:getConnection#
    DBusObjectManagerClientGetConnectionMethodInfo,
    dBusObjectManagerClientGetConnection    ,


-- ** getFlags #method:getFlags#
    DBusObjectManagerClientGetFlagsMethodInfo,
    dBusObjectManagerClientGetFlags         ,


-- ** getName #method:getName#
    DBusObjectManagerClientGetNameMethodInfo,
    dBusObjectManagerClientGetName          ,


-- ** getNameOwner #method:getNameOwner#
    DBusObjectManagerClientGetNameOwnerMethodInfo,
    dBusObjectManagerClientGetNameOwner     ,


-- ** new #method:new#
    dBusObjectManagerClientNew              ,


-- ** newFinish #method:newFinish#
    dBusObjectManagerClientNewFinish        ,


-- ** newForBus #method:newForBus#
    dBusObjectManagerClientNewForBus        ,


-- ** newForBusFinish #method:newForBusFinish#
    dBusObjectManagerClientNewForBusFinish  ,


-- ** newForBusSync #method:newForBusSync#
    dBusObjectManagerClientNewForBusSync    ,


-- ** newSync #method:newSync#
    dBusObjectManagerClientNewSync          ,




 -- * Properties
-- ** busType #attr:busType#
    DBusObjectManagerClientBusTypePropertyInfo,
    constructDBusObjectManagerClientBusType ,
    dBusObjectManagerClientBusType          ,


-- ** connection #attr:connection#
    DBusObjectManagerClientConnectionPropertyInfo,
    constructDBusObjectManagerClientConnection,
    dBusObjectManagerClientConnection       ,
    getDBusObjectManagerClientConnection    ,


-- ** flags #attr:flags#
    DBusObjectManagerClientFlagsPropertyInfo,
    constructDBusObjectManagerClientFlags   ,
    dBusObjectManagerClientFlags            ,
    getDBusObjectManagerClientFlags         ,


-- ** getProxyTypeDestroyNotify #attr:getProxyTypeDestroyNotify#
    DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo,
    constructDBusObjectManagerClientGetProxyTypeDestroyNotify,
    dBusObjectManagerClientGetProxyTypeDestroyNotify,
    getDBusObjectManagerClientGetProxyTypeDestroyNotify,


-- ** getProxyTypeFunc #attr:getProxyTypeFunc#
    DBusObjectManagerClientGetProxyTypeFuncPropertyInfo,
    constructDBusObjectManagerClientGetProxyTypeFunc,
    dBusObjectManagerClientGetProxyTypeFunc ,
    getDBusObjectManagerClientGetProxyTypeFunc,


-- ** getProxyTypeUserData #attr:getProxyTypeUserData#
    DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo,
    constructDBusObjectManagerClientGetProxyTypeUserData,
    dBusObjectManagerClientGetProxyTypeUserData,
    getDBusObjectManagerClientGetProxyTypeUserData,


-- ** name #attr:name#
    DBusObjectManagerClientNamePropertyInfo ,
    constructDBusObjectManagerClientName    ,
    dBusObjectManagerClientName             ,
    getDBusObjectManagerClientName          ,


-- ** nameOwner #attr:nameOwner#
    DBusObjectManagerClientNameOwnerPropertyInfo,
    dBusObjectManagerClientNameOwner        ,
    getDBusObjectManagerClientNameOwner     ,


-- ** objectPath #attr:objectPath#
    DBusObjectManagerClientObjectPathPropertyInfo,
    constructDBusObjectManagerClientObjectPath,
    dBusObjectManagerClientObjectPath       ,
    getDBusObjectManagerClientObjectPath    ,




 -- * Signals
-- ** interfaceProxyPropertiesChanged #signal:interfaceProxyPropertiesChanged#
    C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
    DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
    DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo,
    afterDBusObjectManagerClientInterfaceProxyPropertiesChanged,
    genClosure_DBusObjectManagerClientInterfaceProxyPropertiesChanged,
    mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
    noDBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,
    onDBusObjectManagerClientInterfaceProxyPropertiesChanged,
    wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback,


-- ** interfaceProxySignal #signal:interfaceProxySignal#
    C_DBusObjectManagerClientInterfaceProxySignalCallback,
    DBusObjectManagerClientInterfaceProxySignalCallback,
    DBusObjectManagerClientInterfaceProxySignalSignalInfo,
    afterDBusObjectManagerClientInterfaceProxySignal,
    genClosure_DBusObjectManagerClientInterfaceProxySignal,
    mk_DBusObjectManagerClientInterfaceProxySignalCallback,
    noDBusObjectManagerClientInterfaceProxySignalCallback,
    onDBusObjectManagerClientInterfaceProxySignal,
    wrap_DBusObjectManagerClientInterfaceProxySignalCallback,




    ) where

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

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

import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.DBusObjectManager as Gio.DBusObjectManager
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusObjectProxy as Gio.DBusObjectProxy
import {-# SOURCE #-} qualified GI.Gio.Objects.DBusProxy as Gio.DBusProxy

newtype DBusObjectManagerClient = DBusObjectManagerClient (ManagedPtr DBusObjectManagerClient)
foreign import ccall "g_dbus_object_manager_client_get_type"
    c_g_dbus_object_manager_client_get_type :: IO GType

instance GObject DBusObjectManagerClient where
    gobjectType _ = c_g_dbus_object_manager_client_get_type
    

class GObject o => IsDBusObjectManagerClient o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DBusObjectManagerClient a) =>
    IsDBusObjectManagerClient a
#endif
instance IsDBusObjectManagerClient DBusObjectManagerClient
instance GObject.Object.IsObject DBusObjectManagerClient
instance Gio.AsyncInitable.IsAsyncInitable DBusObjectManagerClient
instance Gio.DBusObjectManager.IsDBusObjectManager DBusObjectManagerClient
instance Gio.Initable.IsInitable DBusObjectManagerClient

toDBusObjectManagerClient :: IsDBusObjectManagerClient o => o -> IO DBusObjectManagerClient
toDBusObjectManagerClient = unsafeCastTo DBusObjectManagerClient

noDBusObjectManagerClient :: Maybe DBusObjectManagerClient
noDBusObjectManagerClient = Nothing

type family ResolveDBusObjectManagerClientMethod (t :: Symbol) (o :: *) :: * where
    ResolveDBusObjectManagerClientMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDBusObjectManagerClientMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDBusObjectManagerClientMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDBusObjectManagerClientMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDBusObjectManagerClientMethod "init" o = Gio.Initable.InitableInitMethodInfo
    ResolveDBusObjectManagerClientMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
    ResolveDBusObjectManagerClientMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
    ResolveDBusObjectManagerClientMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDBusObjectManagerClientMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDBusObjectManagerClientMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDBusObjectManagerClientMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDBusObjectManagerClientMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDBusObjectManagerClientMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveDBusObjectManagerClientMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveDBusObjectManagerClientMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDBusObjectManagerClientMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDBusObjectManagerClientMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDBusObjectManagerClientMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDBusObjectManagerClientMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDBusObjectManagerClientMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDBusObjectManagerClientMethod "getConnection" o = DBusObjectManagerClientGetConnectionMethodInfo
    ResolveDBusObjectManagerClientMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDBusObjectManagerClientMethod "getFlags" o = DBusObjectManagerClientGetFlagsMethodInfo
    ResolveDBusObjectManagerClientMethod "getInterface" o = Gio.DBusObjectManager.DBusObjectManagerGetInterfaceMethodInfo
    ResolveDBusObjectManagerClientMethod "getName" o = DBusObjectManagerClientGetNameMethodInfo
    ResolveDBusObjectManagerClientMethod "getNameOwner" o = DBusObjectManagerClientGetNameOwnerMethodInfo
    ResolveDBusObjectManagerClientMethod "getObject" o = Gio.DBusObjectManager.DBusObjectManagerGetObjectMethodInfo
    ResolveDBusObjectManagerClientMethod "getObjectPath" o = Gio.DBusObjectManager.DBusObjectManagerGetObjectPathMethodInfo
    ResolveDBusObjectManagerClientMethod "getObjects" o = Gio.DBusObjectManager.DBusObjectManagerGetObjectsMethodInfo
    ResolveDBusObjectManagerClientMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDBusObjectManagerClientMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDBusObjectManagerClientMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDBusObjectManagerClientMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDBusObjectManagerClientMethod l o = O.MethodResolutionFailed l o

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

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

-- signal DBusObjectManagerClient::interface-proxy-properties-changed
type DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback =
    Gio.DBusObjectProxy.DBusObjectProxy ->
    Gio.DBusProxy.DBusProxy ->
    GVariant ->
    [T.Text] ->
    IO ()

noDBusObjectManagerClientInterfaceProxyPropertiesChangedCallback :: Maybe DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
noDBusObjectManagerClientInterfaceProxyPropertiesChangedCallback = Nothing

type C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObjectProxy.DBusObjectProxy ->
    Ptr Gio.DBusProxy.DBusProxy ->
    Ptr GVariant ->
    Ptr CString ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback :: C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> IO (FunPtr C_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback)

genClosure_DBusObjectManagerClientInterfaceProxyPropertiesChanged :: DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> IO Closure
genClosure_DBusObjectManagerClientInterfaceProxyPropertiesChanged cb = do
    let cb' = wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb
    mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb' >>= newCClosure


wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback ::
    DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback ->
    Ptr () ->
    Ptr Gio.DBusObjectProxy.DBusObjectProxy ->
    Ptr Gio.DBusProxy.DBusProxy ->
    Ptr GVariant ->
    Ptr CString ->
    Ptr () ->
    IO ()
wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback _cb _ objectProxy interfaceProxy changedProperties invalidatedProperties _ = do
    objectProxy' <- (newObject Gio.DBusObjectProxy.DBusObjectProxy) objectProxy
    interfaceProxy' <- (newObject Gio.DBusProxy.DBusProxy) interfaceProxy
    changedProperties' <- newGVariantFromPtr changedProperties
    invalidatedProperties' <- unpackZeroTerminatedUTF8CArray invalidatedProperties
    _cb  objectProxy' interfaceProxy' changedProperties' invalidatedProperties'


onDBusObjectManagerClientInterfaceProxyPropertiesChanged :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> m SignalHandlerId
onDBusObjectManagerClientInterfaceProxyPropertiesChanged obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb
    cb'' <- mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb'
    connectSignalFunPtr obj "interface-proxy-properties-changed" cb'' SignalConnectBefore

afterDBusObjectManagerClientInterfaceProxyPropertiesChanged :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback -> m SignalHandlerId
afterDBusObjectManagerClientInterfaceProxyPropertiesChanged obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb
    cb'' <- mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb'
    connectSignalFunPtr obj "interface-proxy-properties-changed" cb'' SignalConnectAfter


-- signal DBusObjectManagerClient::interface-proxy-signal
type DBusObjectManagerClientInterfaceProxySignalCallback =
    Gio.DBusObjectProxy.DBusObjectProxy ->
    Gio.DBusProxy.DBusProxy ->
    T.Text ->
    T.Text ->
    GVariant ->
    IO ()

noDBusObjectManagerClientInterfaceProxySignalCallback :: Maybe DBusObjectManagerClientInterfaceProxySignalCallback
noDBusObjectManagerClientInterfaceProxySignalCallback = Nothing

type C_DBusObjectManagerClientInterfaceProxySignalCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObjectProxy.DBusObjectProxy ->
    Ptr Gio.DBusProxy.DBusProxy ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_DBusObjectManagerClientInterfaceProxySignalCallback :: C_DBusObjectManagerClientInterfaceProxySignalCallback -> IO (FunPtr C_DBusObjectManagerClientInterfaceProxySignalCallback)

genClosure_DBusObjectManagerClientInterfaceProxySignal :: DBusObjectManagerClientInterfaceProxySignalCallback -> IO Closure
genClosure_DBusObjectManagerClientInterfaceProxySignal cb = do
    let cb' = wrap_DBusObjectManagerClientInterfaceProxySignalCallback cb
    mk_DBusObjectManagerClientInterfaceProxySignalCallback cb' >>= newCClosure


wrap_DBusObjectManagerClientInterfaceProxySignalCallback ::
    DBusObjectManagerClientInterfaceProxySignalCallback ->
    Ptr () ->
    Ptr Gio.DBusObjectProxy.DBusObjectProxy ->
    Ptr Gio.DBusProxy.DBusProxy ->
    CString ->
    CString ->
    Ptr GVariant ->
    Ptr () ->
    IO ()
wrap_DBusObjectManagerClientInterfaceProxySignalCallback _cb _ objectProxy interfaceProxy senderName signalName parameters _ = do
    objectProxy' <- (newObject Gio.DBusObjectProxy.DBusObjectProxy) objectProxy
    interfaceProxy' <- (newObject Gio.DBusProxy.DBusProxy) interfaceProxy
    senderName' <- cstringToText senderName
    signalName' <- cstringToText signalName
    parameters' <- newGVariantFromPtr parameters
    _cb  objectProxy' interfaceProxy' senderName' signalName' parameters'


onDBusObjectManagerClientInterfaceProxySignal :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxySignalCallback -> m SignalHandlerId
onDBusObjectManagerClientInterfaceProxySignal obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerClientInterfaceProxySignalCallback cb
    cb'' <- mk_DBusObjectManagerClientInterfaceProxySignalCallback cb'
    connectSignalFunPtr obj "interface-proxy-signal" cb'' SignalConnectBefore

afterDBusObjectManagerClientInterfaceProxySignal :: (IsDBusObjectManagerClient a, MonadIO m) => a -> DBusObjectManagerClientInterfaceProxySignalCallback -> m SignalHandlerId
afterDBusObjectManagerClientInterfaceProxySignal obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerClientInterfaceProxySignalCallback cb
    cb'' <- mk_DBusObjectManagerClientInterfaceProxySignalCallback cb'
    connectSignalFunPtr obj "interface-proxy-signal" cb'' SignalConnectAfter


-- VVV Prop "bus-type"
   -- Type: TInterface (Name {namespace = "Gio", name = "BusType"})
   -- Flags: [PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

constructDBusObjectManagerClientBusType :: (IsDBusObjectManagerClient o) => Gio.Enums.BusType -> IO (GValueConstruct o)
constructDBusObjectManagerClientBusType val = constructObjectPropertyEnum "bus-type" val

data DBusObjectManagerClientBusTypePropertyInfo
instance AttrInfo DBusObjectManagerClientBusTypePropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientBusTypePropertyInfo = '[ 'AttrConstruct]
    type AttrSetTypeConstraint DBusObjectManagerClientBusTypePropertyInfo = (~) Gio.Enums.BusType
    type AttrBaseTypeConstraint DBusObjectManagerClientBusTypePropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientBusTypePropertyInfo = ()
    type AttrLabel DBusObjectManagerClientBusTypePropertyInfo = "bus-type"
    type AttrOrigin DBusObjectManagerClientBusTypePropertyInfo = DBusObjectManagerClient
    attrGet _ = undefined
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientBusType
    attrClear _ = undefined

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

getDBusObjectManagerClientConnection :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m Gio.DBusConnection.DBusConnection
getDBusObjectManagerClientConnection obj = liftIO $ checkUnexpectedNothing "getDBusObjectManagerClientConnection" $ getObjectPropertyObject obj "connection" Gio.DBusConnection.DBusConnection

constructDBusObjectManagerClientConnection :: (IsDBusObjectManagerClient o, Gio.DBusConnection.IsDBusConnection a) => a -> IO (GValueConstruct o)
constructDBusObjectManagerClientConnection val = constructObjectPropertyObject "connection" (Just val)

data DBusObjectManagerClientConnectionPropertyInfo
instance AttrInfo DBusObjectManagerClientConnectionPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientConnectionPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientConnectionPropertyInfo = Gio.DBusConnection.IsDBusConnection
    type AttrBaseTypeConstraint DBusObjectManagerClientConnectionPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientConnectionPropertyInfo = Gio.DBusConnection.DBusConnection
    type AttrLabel DBusObjectManagerClientConnectionPropertyInfo = "connection"
    type AttrOrigin DBusObjectManagerClientConnectionPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientConnection
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientConnection
    attrClear _ = undefined

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

getDBusObjectManagerClientFlags :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m [Gio.Flags.DBusObjectManagerClientFlags]
getDBusObjectManagerClientFlags obj = liftIO $ getObjectPropertyFlags obj "flags"

constructDBusObjectManagerClientFlags :: (IsDBusObjectManagerClient o) => [Gio.Flags.DBusObjectManagerClientFlags] -> IO (GValueConstruct o)
constructDBusObjectManagerClientFlags val = constructObjectPropertyFlags "flags" val

data DBusObjectManagerClientFlagsPropertyInfo
instance AttrInfo DBusObjectManagerClientFlagsPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientFlagsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientFlagsPropertyInfo = (~) [Gio.Flags.DBusObjectManagerClientFlags]
    type AttrBaseTypeConstraint DBusObjectManagerClientFlagsPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientFlagsPropertyInfo = [Gio.Flags.DBusObjectManagerClientFlags]
    type AttrLabel DBusObjectManagerClientFlagsPropertyInfo = "flags"
    type AttrOrigin DBusObjectManagerClientFlagsPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientFlags
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientFlags
    attrClear _ = undefined

-- VVV Prop "get-proxy-type-destroy-notify"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getDBusObjectManagerClientGetProxyTypeDestroyNotify :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeDestroyNotify obj = liftIO $ getObjectPropertyPtr obj "get-proxy-type-destroy-notify"

constructDBusObjectManagerClientGetProxyTypeDestroyNotify :: (IsDBusObjectManagerClient o) => Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeDestroyNotify val = constructObjectPropertyPtr "get-proxy-type-destroy-notify" val

data DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo
instance AttrInfo DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = (Ptr ())
    type AttrLabel DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = "get-proxy-type-destroy-notify"
    type AttrOrigin DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientGetProxyTypeDestroyNotify
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientGetProxyTypeDestroyNotify
    attrClear _ = undefined

-- VVV Prop "get-proxy-type-func"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getDBusObjectManagerClientGetProxyTypeFunc :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeFunc obj = liftIO $ getObjectPropertyPtr obj "get-proxy-type-func"

constructDBusObjectManagerClientGetProxyTypeFunc :: (IsDBusObjectManagerClient o) => Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeFunc val = constructObjectPropertyPtr "get-proxy-type-func" val

data DBusObjectManagerClientGetProxyTypeFuncPropertyInfo
instance AttrInfo DBusObjectManagerClientGetProxyTypeFuncPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = (Ptr ())
    type AttrLabel DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = "get-proxy-type-func"
    type AttrOrigin DBusObjectManagerClientGetProxyTypeFuncPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientGetProxyTypeFunc
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientGetProxyTypeFunc
    attrClear _ = undefined

-- VVV Prop "get-proxy-type-user-data"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getDBusObjectManagerClientGetProxyTypeUserData :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Ptr ())
getDBusObjectManagerClientGetProxyTypeUserData obj = liftIO $ getObjectPropertyPtr obj "get-proxy-type-user-data"

constructDBusObjectManagerClientGetProxyTypeUserData :: (IsDBusObjectManagerClient o) => Ptr () -> IO (GValueConstruct o)
constructDBusObjectManagerClientGetProxyTypeUserData val = constructObjectPropertyPtr "get-proxy-type-user-data" val

data DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo
instance AttrInfo DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = (Ptr ())
    type AttrLabel DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = "get-proxy-type-user-data"
    type AttrOrigin DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientGetProxyTypeUserData
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientGetProxyTypeUserData
    attrClear _ = undefined

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

getDBusObjectManagerClientName :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m T.Text
getDBusObjectManagerClientName obj = liftIO $ checkUnexpectedNothing "getDBusObjectManagerClientName" $ getObjectPropertyString obj "name"

constructDBusObjectManagerClientName :: (IsDBusObjectManagerClient o) => T.Text -> IO (GValueConstruct o)
constructDBusObjectManagerClientName val = constructObjectPropertyString "name" (Just val)

data DBusObjectManagerClientNamePropertyInfo
instance AttrInfo DBusObjectManagerClientNamePropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientNamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DBusObjectManagerClientNamePropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientNamePropertyInfo = T.Text
    type AttrLabel DBusObjectManagerClientNamePropertyInfo = "name"
    type AttrOrigin DBusObjectManagerClientNamePropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientName
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientName
    attrClear _ = undefined

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

getDBusObjectManagerClientNameOwner :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Maybe T.Text)
getDBusObjectManagerClientNameOwner obj = liftIO $ getObjectPropertyString obj "name-owner"

data DBusObjectManagerClientNameOwnerPropertyInfo
instance AttrInfo DBusObjectManagerClientNameOwnerPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientNameOwnerPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientNameOwnerPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DBusObjectManagerClientNameOwnerPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientNameOwnerPropertyInfo = (Maybe T.Text)
    type AttrLabel DBusObjectManagerClientNameOwnerPropertyInfo = "name-owner"
    type AttrOrigin DBusObjectManagerClientNameOwnerPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientNameOwner
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

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

getDBusObjectManagerClientObjectPath :: (MonadIO m, IsDBusObjectManagerClient o) => o -> m (Maybe T.Text)
getDBusObjectManagerClientObjectPath obj = liftIO $ getObjectPropertyString obj "object-path"

constructDBusObjectManagerClientObjectPath :: (IsDBusObjectManagerClient o) => T.Text -> IO (GValueConstruct o)
constructDBusObjectManagerClientObjectPath val = constructObjectPropertyString "object-path" (Just val)

data DBusObjectManagerClientObjectPathPropertyInfo
instance AttrInfo DBusObjectManagerClientObjectPathPropertyInfo where
    type AttrAllowedOps DBusObjectManagerClientObjectPathPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DBusObjectManagerClientObjectPathPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DBusObjectManagerClientObjectPathPropertyInfo = IsDBusObjectManagerClient
    type AttrGetType DBusObjectManagerClientObjectPathPropertyInfo = (Maybe T.Text)
    type AttrLabel DBusObjectManagerClientObjectPathPropertyInfo = "object-path"
    type AttrOrigin DBusObjectManagerClientObjectPathPropertyInfo = DBusObjectManagerClient
    attrGet _ = getDBusObjectManagerClientObjectPath
    attrSet _ = undefined
    attrConstruct _ = constructDBusObjectManagerClientObjectPath
    attrClear _ = undefined

instance O.HasAttributeList DBusObjectManagerClient
type instance O.AttributeList DBusObjectManagerClient = DBusObjectManagerClientAttributeList
type DBusObjectManagerClientAttributeList = ('[ '("busType", DBusObjectManagerClientBusTypePropertyInfo), '("connection", DBusObjectManagerClientConnectionPropertyInfo), '("flags", DBusObjectManagerClientFlagsPropertyInfo), '("getProxyTypeDestroyNotify", DBusObjectManagerClientGetProxyTypeDestroyNotifyPropertyInfo), '("getProxyTypeFunc", DBusObjectManagerClientGetProxyTypeFuncPropertyInfo), '("getProxyTypeUserData", DBusObjectManagerClientGetProxyTypeUserDataPropertyInfo), '("name", DBusObjectManagerClientNamePropertyInfo), '("nameOwner", DBusObjectManagerClientNameOwnerPropertyInfo), '("objectPath", DBusObjectManagerClientObjectPathPropertyInfo)] :: [(Symbol, *)])

dBusObjectManagerClientBusType :: AttrLabelProxy "busType"
dBusObjectManagerClientBusType = AttrLabelProxy

dBusObjectManagerClientConnection :: AttrLabelProxy "connection"
dBusObjectManagerClientConnection = AttrLabelProxy

dBusObjectManagerClientFlags :: AttrLabelProxy "flags"
dBusObjectManagerClientFlags = AttrLabelProxy

dBusObjectManagerClientGetProxyTypeDestroyNotify :: AttrLabelProxy "getProxyTypeDestroyNotify"
dBusObjectManagerClientGetProxyTypeDestroyNotify = AttrLabelProxy

dBusObjectManagerClientGetProxyTypeFunc :: AttrLabelProxy "getProxyTypeFunc"
dBusObjectManagerClientGetProxyTypeFunc = AttrLabelProxy

dBusObjectManagerClientGetProxyTypeUserData :: AttrLabelProxy "getProxyTypeUserData"
dBusObjectManagerClientGetProxyTypeUserData = AttrLabelProxy

dBusObjectManagerClientName :: AttrLabelProxy "name"
dBusObjectManagerClientName = AttrLabelProxy

dBusObjectManagerClientNameOwner :: AttrLabelProxy "nameOwner"
dBusObjectManagerClientNameOwner = AttrLabelProxy

dBusObjectManagerClientObjectPath :: AttrLabelProxy "objectPath"
dBusObjectManagerClientObjectPath = AttrLabelProxy

data DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo
instance SignalInfo DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo where
    type HaskellCallbackType DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo = DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb
        cb'' <- mk_DBusObjectManagerClientInterfaceProxyPropertiesChangedCallback cb'
        connectSignalFunPtr obj "interface-proxy-properties-changed" cb'' connectMode

data DBusObjectManagerClientInterfaceProxySignalSignalInfo
instance SignalInfo DBusObjectManagerClientInterfaceProxySignalSignalInfo where
    type HaskellCallbackType DBusObjectManagerClientInterfaceProxySignalSignalInfo = DBusObjectManagerClientInterfaceProxySignalCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerClientInterfaceProxySignalCallback cb
        cb'' <- mk_DBusObjectManagerClientInterfaceProxySignalCallback cb'
        connectSignalFunPtr obj "interface-proxy-signal" cb'' connectMode

type instance O.SignalList DBusObjectManagerClient = DBusObjectManagerClientSignalList
type DBusObjectManagerClientSignalList = ('[ '("interfaceAdded", Gio.DBusObjectManager.DBusObjectManagerInterfaceAddedSignalInfo), '("interfaceProxyPropertiesChanged", DBusObjectManagerClientInterfaceProxyPropertiesChangedSignalInfo), '("interfaceProxySignal", DBusObjectManagerClientInterfaceProxySignalSignalInfo), '("interfaceRemoved", Gio.DBusObjectManager.DBusObjectManagerInterfaceRemovedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("objectAdded", Gio.DBusObjectManager.DBusObjectManagerObjectAddedSignalInfo), '("objectRemoved", Gio.DBusObjectManager.DBusObjectManagerObjectRemovedSignalInfo)] :: [(Symbol, *)])

-- method DBusObjectManagerClient::new_finish
-- method type : Constructor
-- Args : [Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

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

{- |
Finishes an operation started with 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew'.

@since 2.30
-}
dBusObjectManagerClientNewFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
    a
    {- ^ /@res@/: A 'GI.Gio.Interfaces.AsyncResult.AsyncResult' obtained from the 'GI.Gio.Callbacks.AsyncReadyCallback' passed to 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew'. -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewFinish res = liftIO $ do
    res' <- unsafeManagedPtrCastPtr res
    onException (do
        result <- propagateGError $ g_dbus_object_manager_client_new_finish res'
        checkUnexpectedReturnNULL "dBusObjectManagerClientNewFinish" result
        result' <- (wrapObject DBusObjectManagerClient) result
        touchManagedPtr res
        return result'
     ) (do
        return ()
     )

-- method DBusObjectManagerClient::new_for_bus_finish
-- method type : Constructor
-- Args : [Arg {argCName = "res", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

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

{- |
Finishes an operation started with 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBus'.

@since 2.30
-}
dBusObjectManagerClientNewForBusFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
    a
    {- ^ /@res@/: A 'GI.Gio.Interfaces.AsyncResult.AsyncResult' obtained from the 'GI.Gio.Callbacks.AsyncReadyCallback' passed to 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBus'. -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewForBusFinish res = liftIO $ do
    res' <- unsafeManagedPtrCastPtr res
    onException (do
        result <- propagateGError $ g_dbus_object_manager_client_new_for_bus_finish res'
        checkUnexpectedReturnNULL "dBusObjectManagerClientNewForBusFinish" result
        result' <- (wrapObject DBusObjectManagerClient) result
        touchManagedPtr res
        return result'
     ) (do
        return ()
     )

-- method DBusObjectManagerClient::new_for_bus_sync
-- method type : Constructor
-- Args : [Arg {argCName = "bus_type", argType = TInterface (Name {namespace = "Gio", name = "BusType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GBusType.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new_for_bus_sync" g_dbus_object_manager_client_new_for_bus_sync :: 
    CUInt ->                                -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr DBusObjectManagerClient)

{- |
Like 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewSync' but takes a 'GI.Gio.Enums.BusType' instead
of a 'GI.Gio.Objects.DBusConnection.DBusConnection'.

This is a synchronous failable constructor - the calling thread is
blocked until a reply is received. See 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBus'
for the asynchronous version.

@since 2.30
-}
dBusObjectManagerClientNewForBusSync ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    Gio.Enums.BusType
    {- ^ /@busType@/: A 'GI.Gio.Enums.BusType'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> T.Text
    {- ^ /@name@/: The owner of the control object (unique or well-known name). -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (a)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewForBusSync busType flags name objectPath getProxyTypeFunc cancellable = liftIO $ do
    let busType' = (fromIntegral . fromEnum) busType
    let flags' = gflagsToWord flags
    name' <- textToCString name
    objectPath' <- textToCString objectPath
    maybeGetProxyTypeFunc <- case getProxyTypeFunc of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jGetProxyTypeFunc -> do
            jGetProxyTypeFunc' <- Gio.Callbacks.mk_DBusProxyTypeFunc (Gio.Callbacks.wrap_DBusProxyTypeFunc Nothing (Gio.Callbacks.drop_closures_DBusProxyTypeFunc jGetProxyTypeFunc))
            return jGetProxyTypeFunc'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    let getProxyTypeUserData = castFunPtrToPtr maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify = safeFreeFunPtrPtr
    onException (do
        result <- propagateGError $ g_dbus_object_manager_client_new_for_bus_sync busType' flags' name' objectPath' maybeGetProxyTypeFunc getProxyTypeUserData getProxyTypeDestroyNotify maybeCancellable
        checkUnexpectedReturnNULL "dBusObjectManagerClientNewForBusSync" result
        result' <- (wrapObject DBusObjectManagerClient) result
        whenJust cancellable touchManagedPtr
        freeMem name'
        freeMem objectPath'
        return result'
     ) (do
        freeMem name'
        freeMem objectPath'
     )

-- method DBusObjectManagerClient::new_sync
-- method type : Constructor
-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}))
-- throws : True
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new_sync" g_dbus_object_manager_client_new_sync :: 
    Ptr Gio.DBusConnection.DBusConnection -> -- connection : TInterface (Name {namespace = "Gio", name = "DBusConnection"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr DBusObjectManagerClient)

{- |
Creates a new 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object.

This is a synchronous failable constructor - the calling thread is
blocked until a reply is received. See 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew'
for the asynchronous version.

@since 2.30
-}
dBusObjectManagerClientNewSync ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> Maybe (T.Text)
    {- ^ /@name@/: The owner of the control object (unique or well-known name), or 'Nothing' when not using a message bus connection. -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> m DBusObjectManagerClient
    {- ^ __Returns:__ A
  'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object or 'Nothing' if /@error@/ is set. Free
  with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ -}
dBusObjectManagerClientNewSync connection flags name objectPath getProxyTypeFunc cancellable = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    let flags' = gflagsToWord flags
    maybeName <- case name of
        Nothing -> return nullPtr
        Just jName -> do
            jName' <- textToCString jName
            return jName'
    objectPath' <- textToCString objectPath
    maybeGetProxyTypeFunc <- case getProxyTypeFunc of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jGetProxyTypeFunc -> do
            jGetProxyTypeFunc' <- Gio.Callbacks.mk_DBusProxyTypeFunc (Gio.Callbacks.wrap_DBusProxyTypeFunc Nothing (Gio.Callbacks.drop_closures_DBusProxyTypeFunc jGetProxyTypeFunc))
            return jGetProxyTypeFunc'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    let getProxyTypeUserData = castFunPtrToPtr maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify = safeFreeFunPtrPtr
    onException (do
        result <- propagateGError $ g_dbus_object_manager_client_new_sync connection' flags' maybeName objectPath' maybeGetProxyTypeFunc getProxyTypeUserData getProxyTypeDestroyNotify maybeCancellable
        checkUnexpectedReturnNULL "dBusObjectManagerClientNewSync" result
        result' <- (wrapObject DBusObjectManagerClient) result
        touchManagedPtr connection
        whenJust cancellable touchManagedPtr
        freeMem maybeName
        freeMem objectPath'
        return result'
     ) (do
        freeMem maybeName
        freeMem objectPath'
     )

-- method DBusObjectManagerClient::get_connection
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManagerClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusConnection"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_get_connection" g_dbus_object_manager_client_get_connection :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO (Ptr Gio.DBusConnection.DBusConnection)

{- |
Gets the 'GI.Gio.Objects.DBusConnection.DBusConnection' used by /@manager@/.

@since 2.30
-}
dBusObjectManagerClientGetConnection ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' -}
    -> m Gio.DBusConnection.DBusConnection
    {- ^ __Returns:__ A 'GI.Gio.Objects.DBusConnection.DBusConnection' object. Do not free,
  the object belongs to /@manager@/. -}
dBusObjectManagerClientGetConnection manager = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    result <- g_dbus_object_manager_client_get_connection manager'
    checkUnexpectedReturnNULL "dBusObjectManagerClientGetConnection" result
    result' <- (newObject Gio.DBusConnection.DBusConnection) result
    touchManagedPtr manager
    return result'

data DBusObjectManagerClientGetConnectionMethodInfo
instance (signature ~ (m Gio.DBusConnection.DBusConnection), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetConnectionMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetConnection

-- method DBusObjectManagerClient::get_flags
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManagerClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_get_flags" g_dbus_object_manager_client_get_flags :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO CUInt

{- |
Gets the flags that /@manager@/ was constructed with.

@since 2.30
-}
dBusObjectManagerClientGetFlags ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' -}
    -> m [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ __Returns:__ Zero of more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags'
enumeration. -}
dBusObjectManagerClientGetFlags manager = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    result <- g_dbus_object_manager_client_get_flags manager'
    let result' = wordToGFlags result
    touchManagedPtr manager
    return result'

data DBusObjectManagerClientGetFlagsMethodInfo
instance (signature ~ (m [Gio.Flags.DBusObjectManagerClientFlags]), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetFlagsMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetFlags

-- method DBusObjectManagerClient::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManagerClient", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_get_name" g_dbus_object_manager_client_get_name :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO CString

{- |
Gets the name that /@manager@/ is for, or 'Nothing' if not a message bus
connection.

@since 2.30
-}
dBusObjectManagerClientGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' -}
    -> m T.Text
    {- ^ __Returns:__ A unique or well-known name. Do not free, the string
belongs to /@manager@/. -}
dBusObjectManagerClientGetName manager = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    result <- g_dbus_object_manager_client_get_name manager'
    checkUnexpectedReturnNULL "dBusObjectManagerClientGetName" result
    result' <- cstringToText result
    touchManagedPtr manager
    return result'

data DBusObjectManagerClientGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetNameMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetName

-- method DBusObjectManagerClient::get_name_owner
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManagerClient.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_get_name_owner" g_dbus_object_manager_client_get_name_owner :: 
    Ptr DBusObjectManagerClient ->          -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClient"})
    IO CString

{- |
The unique name that owns the name that /@manager@/ is for or 'Nothing' if
no-one currently owns that name. You can connect to the
'GI.GObject.Objects.Object.Object'::@/notify/@ signal to track changes to the
'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient':@/name-owner/@ property.

@since 2.30
-}
dBusObjectManagerClientGetNameOwner ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManagerClient a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient'. -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ The name owner or 'Nothing' if no name owner
exists. Free with 'GI.GLib.Functions.free'. -}
dBusObjectManagerClientGetNameOwner manager = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    result <- g_dbus_object_manager_client_get_name_owner manager'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr manager
    return maybeResult

data DBusObjectManagerClientGetNameOwnerMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDBusObjectManagerClient a) => O.MethodInfo DBusObjectManagerClientGetNameOwnerMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerClientGetNameOwner

-- method DBusObjectManagerClient::new
-- method type : MemberFunction
-- Args : [Arg {argCName = "connection", argType = TInterface (Name {namespace = "Gio", name = "DBusConnection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusConnection.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GAsyncReadyCallback to call when the request is satisfied.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 9, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The data to pass to @callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new" g_dbus_object_manager_client_new :: 
    Ptr Gio.DBusConnection.DBusConnection -> -- connection : TInterface (Name {namespace = "Gio", name = "DBusConnection"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    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 creates a new 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' object.

This is an asynchronous failable constructor. When the result is
ready, /@callback@/ will be invoked in the
[thread-default main context][g-main-context-push-thread-default]
of the thread you are calling this method from. You can
then call 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewFinish' to get the result. See
'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewSync' for the synchronous version.

@since 2.30
-}
dBusObjectManagerClientNew ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@connection@/: A 'GI.Gio.Objects.DBusConnection.DBusConnection'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> T.Text
    {- ^ /@name@/: The owner of the control object (unique or well-known name). -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (b)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: A 'GI.Gio.Callbacks.AsyncReadyCallback' to call when the request is satisfied. -}
    -> m ()
dBusObjectManagerClientNew connection flags name objectPath getProxyTypeFunc cancellable callback = liftIO $ do
    connection' <- unsafeManagedPtrCastPtr connection
    let flags' = gflagsToWord flags
    name' <- textToCString name
    objectPath' <- textToCString objectPath
    maybeGetProxyTypeFunc <- case getProxyTypeFunc of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jGetProxyTypeFunc -> do
            jGetProxyTypeFunc' <- Gio.Callbacks.mk_DBusProxyTypeFunc (Gio.Callbacks.wrap_DBusProxyTypeFunc Nothing (Gio.Callbacks.drop_closures_DBusProxyTypeFunc jGetProxyTypeFunc))
            return jGetProxyTypeFunc'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let getProxyTypeUserData = castFunPtrToPtr maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify = safeFreeFunPtrPtr
    let userData = nullPtr
    g_dbus_object_manager_client_new connection' flags' name' objectPath' maybeGetProxyTypeFunc getProxyTypeUserData getProxyTypeDestroyNotify maybeCancellable maybeCallback userData
    touchManagedPtr connection
    whenJust cancellable touchManagedPtr
    freeMem name'
    freeMem objectPath'
    return ()

-- method DBusObjectManagerClient::new_for_bus
-- method type : MemberFunction
-- Args : [Arg {argCName = "bus_type", argType = TInterface (Name {namespace = "Gio", name = "BusType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GBusType.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The owner of the control object (unique or well-known name).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The object path of the control object.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_func", argType = TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 5, argDestroy = 6, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "User data to pass to @get_proxy_type_func.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "get_proxy_type_destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "Free function for @get_proxy_type_user_data or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GCancellable or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #GAsyncReadyCallback to call when the request is satisfied.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 9, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The data to pass to @callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_client_new_for_bus" g_dbus_object_manager_client_new_for_bus :: 
    CUInt ->                                -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "DBusObjectManagerClientFlags"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- object_path : TBasicType TUTF8
    FunPtr Gio.Callbacks.C_DBusProxyTypeFunc -> -- get_proxy_type_func : TInterface (Name {namespace = "Gio", name = "DBusProxyTypeFunc"})
    Ptr () ->                               -- get_proxy_type_user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- get_proxy_type_destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    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 ()

{- |
Like 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNew' but takes a 'GI.Gio.Enums.BusType' instead of a
'GI.Gio.Objects.DBusConnection.DBusConnection'.

This is an asynchronous failable constructor. When the result is
ready, /@callback@/ will be invoked in the
[thread-default main loop][g-main-context-push-thread-default]
of the thread you are calling this method from. You can
then call 'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBusFinish' to get the result. See
'GI.Gio.Objects.DBusObjectManagerClient.dBusObjectManagerClientNewForBusSync' for the synchronous version.

@since 2.30
-}
dBusObjectManagerClientNewForBus ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
    Gio.Enums.BusType
    {- ^ /@busType@/: A 'GI.Gio.Enums.BusType'. -}
    -> [Gio.Flags.DBusObjectManagerClientFlags]
    {- ^ /@flags@/: Zero or more flags from the 'GI.Gio.Flags.DBusObjectManagerClientFlags' enumeration. -}
    -> T.Text
    {- ^ /@name@/: The owner of the control object (unique or well-known name). -}
    -> T.Text
    {- ^ /@objectPath@/: The object path of the control object. -}
    -> Maybe (Gio.Callbacks.DBusProxyTypeFunc)
    {- ^ /@getProxyTypeFunc@/: A 'GI.Gio.Callbacks.DBusProxyTypeFunc' function or 'Nothing' to always construct 'GI.Gio.Objects.DBusProxy.DBusProxy' proxies. -}
    -> Maybe (a)
    {- ^ /@cancellable@/: A 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: A 'GI.Gio.Callbacks.AsyncReadyCallback' to call when the request is satisfied. -}
    -> m ()
dBusObjectManagerClientNewForBus busType flags name objectPath getProxyTypeFunc cancellable callback = liftIO $ do
    let busType' = (fromIntegral . fromEnum) busType
    let flags' = gflagsToWord flags
    name' <- textToCString name
    objectPath' <- textToCString objectPath
    maybeGetProxyTypeFunc <- case getProxyTypeFunc of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jGetProxyTypeFunc -> do
            jGetProxyTypeFunc' <- Gio.Callbacks.mk_DBusProxyTypeFunc (Gio.Callbacks.wrap_DBusProxyTypeFunc Nothing (Gio.Callbacks.drop_closures_DBusProxyTypeFunc jGetProxyTypeFunc))
            return jGetProxyTypeFunc'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let getProxyTypeUserData = castFunPtrToPtr maybeGetProxyTypeFunc
    let getProxyTypeDestroyNotify = safeFreeFunPtrPtr
    let userData = nullPtr
    g_dbus_object_manager_client_new_for_bus busType' flags' name' objectPath' maybeGetProxyTypeFunc getProxyTypeUserData getProxyTypeDestroyNotify maybeCancellable maybeCallback userData
    whenJust cancellable touchManagedPtr
    freeMem name'
    freeMem objectPath'
    return ()