{-# 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./
-- 
-- /Since: 1.2/

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

module GI.NM.Objects.DeviceTun
    ( 

-- * Exported types
    DeviceTun(..)                           ,
    IsDeviceTun                             ,
    toDeviceTun                             ,


 -- * 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"), [connectionCompatible]("GI.NM.Objects.Device#g:method:connectionCompatible"), [connectionValid]("GI.NM.Objects.Device#g:method:connectionValid"), [delete]("GI.NM.Objects.Device#g:method:delete"), [deleteAsync]("GI.NM.Objects.Device#g:method:deleteAsync"), [deleteFinish]("GI.NM.Objects.Device#g:method:deleteFinish"), [disconnect]("GI.NM.Objects.Device#g:method:disconnect"), [disconnectAsync]("GI.NM.Objects.Device#g:method:disconnectAsync"), [disconnectFinish]("GI.NM.Objects.Device#g:method:disconnectFinish"), [filterConnections]("GI.NM.Objects.Device#g:method:filterConnections"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isReal]("GI.NM.Objects.Device#g:method:isReal"), [isSoftware]("GI.NM.Objects.Device#g:method:isSoftware"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [reapply]("GI.NM.Objects.Device#g:method:reapply"), [reapplyAsync]("GI.NM.Objects.Device#g:method:reapplyAsync"), [reapplyFinish]("GI.NM.Objects.Device#g:method:reapplyFinish"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [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"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getActiveConnection]("GI.NM.Objects.Device#g:method:getActiveConnection"), [getAppliedConnection]("GI.NM.Objects.Device#g:method:getAppliedConnection"), [getAppliedConnectionAsync]("GI.NM.Objects.Device#g:method:getAppliedConnectionAsync"), [getAppliedConnectionFinish]("GI.NM.Objects.Device#g:method:getAppliedConnectionFinish"), [getAutoconnect]("GI.NM.Objects.Device#g:method:getAutoconnect"), [getAvailableConnections]("GI.NM.Objects.Device#g:method:getAvailableConnections"), [getCapabilities]("GI.NM.Objects.Device#g:method:getCapabilities"), [getClient]("GI.NM.Objects.Object#g:method:getClient"), [getConnectivity]("GI.NM.Objects.Device#g:method:getConnectivity"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDescription]("GI.NM.Objects.Device#g:method:getDescription"), [getDeviceType]("GI.NM.Objects.Device#g:method:getDeviceType"), [getDhcp4Config]("GI.NM.Objects.Device#g:method:getDhcp4Config"), [getDhcp6Config]("GI.NM.Objects.Device#g:method:getDhcp6Config"), [getDriver]("GI.NM.Objects.Device#g:method:getDriver"), [getDriverVersion]("GI.NM.Objects.Device#g:method:getDriverVersion"), [getFirmwareMissing]("GI.NM.Objects.Device#g:method:getFirmwareMissing"), [getFirmwareVersion]("GI.NM.Objects.Device#g:method:getFirmwareVersion"), [getGroup]("GI.NM.Objects.DeviceTun#g:method:getGroup"), [getHwAddress]("GI.NM.Objects.Device#g:method:getHwAddress"), [getIface]("GI.NM.Objects.Device#g:method:getIface"), [getInterfaceFlags]("GI.NM.Objects.Device#g:method:getInterfaceFlags"), [getIp4Config]("GI.NM.Objects.Device#g:method:getIp4Config"), [getIp6Config]("GI.NM.Objects.Device#g:method:getIp6Config"), [getIpIface]("GI.NM.Objects.Device#g:method:getIpIface"), [getLldpNeighbors]("GI.NM.Objects.Device#g:method:getLldpNeighbors"), [getManaged]("GI.NM.Objects.Device#g:method:getManaged"), [getMetered]("GI.NM.Objects.Device#g:method:getMetered"), [getMode]("GI.NM.Objects.DeviceTun#g:method:getMode"), [getMtu]("GI.NM.Objects.Device#g:method:getMtu"), [getMultiQueue]("GI.NM.Objects.DeviceTun#g:method:getMultiQueue"), [getNmPluginMissing]("GI.NM.Objects.Device#g:method:getNmPluginMissing"), [getNoPi]("GI.NM.Objects.DeviceTun#g:method:getNoPi"), [getOwner]("GI.NM.Objects.DeviceTun#g:method:getOwner"), [getPath]("GI.NM.Objects.Device#g:method:getPath"), [getPhysicalPortId]("GI.NM.Objects.Device#g:method:getPhysicalPortId"), [getPorts]("GI.NM.Objects.Device#g:method:getPorts"), [getProduct]("GI.NM.Objects.Device#g:method:getProduct"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSettingType]("GI.NM.Objects.Device#g:method:getSettingType"), [getState]("GI.NM.Objects.Device#g:method:getState"), [getStateReason]("GI.NM.Objects.Device#g:method:getStateReason"), [getTypeDescription]("GI.NM.Objects.Device#g:method:getTypeDescription"), [getUdi]("GI.NM.Objects.Device#g:method:getUdi"), [getVendor]("GI.NM.Objects.Device#g:method:getVendor"), [getVnetHdr]("GI.NM.Objects.DeviceTun#g:method:getVnetHdr").
-- 
-- ==== Setters
-- [setAutoconnect]("GI.NM.Objects.Device#g:method:setAutoconnect"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setManaged]("GI.NM.Objects.Device#g:method:setManaged"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveDeviceTunMethod                  ,
#endif

-- ** getGroup #method:getGroup#

#if defined(ENABLE_OVERLOADING)
    DeviceTunGetGroupMethodInfo             ,
#endif
    deviceTunGetGroup                       ,


-- ** getMode #method:getMode#

#if defined(ENABLE_OVERLOADING)
    DeviceTunGetModeMethodInfo              ,
#endif
    deviceTunGetMode                        ,


-- ** getMultiQueue #method:getMultiQueue#

#if defined(ENABLE_OVERLOADING)
    DeviceTunGetMultiQueueMethodInfo        ,
#endif
    deviceTunGetMultiQueue                  ,


-- ** getNoPi #method:getNoPi#

#if defined(ENABLE_OVERLOADING)
    DeviceTunGetNoPiMethodInfo              ,
#endif
    deviceTunGetNoPi                        ,


-- ** getOwner #method:getOwner#

#if defined(ENABLE_OVERLOADING)
    DeviceTunGetOwnerMethodInfo             ,
#endif
    deviceTunGetOwner                       ,


-- ** getVnetHdr #method:getVnetHdr#

#if defined(ENABLE_OVERLOADING)
    DeviceTunGetVnetHdrMethodInfo           ,
#endif
    deviceTunGetVnetHdr                     ,




 -- * Properties


-- ** group #attr:group#
-- | The gid of the tunnel group, or -1 if it has no owner.
-- 
-- /Since: 1.2/

#if defined(ENABLE_OVERLOADING)
    DeviceTunGroupPropertyInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    deviceTunGroup                          ,
#endif
    getDeviceTunGroup                       ,


-- ** mode #attr:mode#
-- | The tunnel mode, either \"tun\" or \"tap\".
-- 
-- /Since: 1.2/

#if defined(ENABLE_OVERLOADING)
    DeviceTunModePropertyInfo               ,
#endif
#if defined(ENABLE_OVERLOADING)
    deviceTunMode                           ,
#endif
    getDeviceTunMode                        ,


-- ** multiQueue #attr:multiQueue#
-- | The tunnel\'s \"TUN_TAP_MQ\" flag; true if callers can connect to
-- the tap device multiple times, for multiple send\/receive
-- queues.
-- 
-- /Since: 1.2/

#if defined(ENABLE_OVERLOADING)
    DeviceTunMultiQueuePropertyInfo         ,
#endif
#if defined(ENABLE_OVERLOADING)
    deviceTunMultiQueue                     ,
#endif
    getDeviceTunMultiQueue                  ,


-- ** noPi #attr:noPi#
-- | The tunnel\'s \"TUN_NO_PI\" flag; true if no protocol info is
-- prepended to the tunnel packets.
-- 
-- /Since: 1.2/

#if defined(ENABLE_OVERLOADING)
    DeviceTunNoPiPropertyInfo               ,
#endif
#if defined(ENABLE_OVERLOADING)
    deviceTunNoPi                           ,
#endif
    getDeviceTunNoPi                        ,


-- ** owner #attr:owner#
-- | The uid of the tunnel owner, or -1 if it has no owner.
-- 
-- /Since: 1.2/

#if defined(ENABLE_OVERLOADING)
    DeviceTunOwnerPropertyInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    deviceTunOwner                          ,
#endif
    getDeviceTunOwner                       ,


-- ** vnetHdr #attr:vnetHdr#
-- | The tunnel\'s \"TUN_VNET_HDR\" flag; true if the tunnel packets
-- include a virtio network header.
-- 
-- /Since: 1.2/

#if defined(ENABLE_OVERLOADING)
    DeviceTunVnetHdrPropertyInfo            ,
#endif
#if defined(ENABLE_OVERLOADING)
    deviceTunVnetHdr                        ,
#endif
    getDeviceTunVnetHdr                     ,




    ) 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.ActiveConnection as NM.ActiveConnection
import {-# SOURCE #-} qualified GI.NM.Objects.Checkpoint as NM.Checkpoint
import {-# SOURCE #-} qualified GI.NM.Objects.Client as NM.Client
import {-# SOURCE #-} qualified GI.NM.Objects.Device as NM.Device
import {-# SOURCE #-} qualified GI.NM.Objects.DhcpConfig as NM.DhcpConfig
import {-# SOURCE #-} qualified GI.NM.Objects.IPConfig as NM.IPConfig
import {-# SOURCE #-} qualified GI.NM.Objects.Object as NM.Object
import {-# SOURCE #-} qualified GI.NM.Objects.RemoteConnection as NM.RemoteConnection
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.DnsEntry as NM.DnsEntry
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.LldpNeighbor as NM.LldpNeighbor
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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.NM.Objects.Device as NM.Device
import {-# SOURCE #-} qualified GI.NM.Objects.Object as NM.Object

#endif

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

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

foreign import ccall "nm_device_tun_get_type"
    c_nm_device_tun_get_type :: IO B.Types.GType

instance B.Types.TypedObject DeviceTun where
    glibType :: IO GType
glibType = IO GType
c_nm_device_tun_get_type

instance B.Types.GObject DeviceTun

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

instance O.HasParentTypes DeviceTun
type instance O.ParentTypes DeviceTun = '[NM.Device.Device, NM.Object.Object, GObject.Object.Object]

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

-- | Convert t'DeviceTun' 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 DeviceTun) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_nm_device_tun_get_type
    gvalueSet_ :: Ptr GValue -> Maybe DeviceTun -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DeviceTun
P.Nothing = Ptr GValue -> Ptr DeviceTun -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr DeviceTun
forall a. Ptr a
FP.nullPtr :: FP.Ptr DeviceTun)
    gvalueSet_ Ptr GValue
gv (P.Just DeviceTun
obj) = DeviceTun -> (Ptr DeviceTun -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DeviceTun
obj (Ptr GValue -> Ptr DeviceTun -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe DeviceTun)
gvalueGet_ Ptr GValue
gv = do
        Ptr DeviceTun
ptr <- Ptr GValue -> IO (Ptr DeviceTun)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DeviceTun)
        if Ptr DeviceTun
ptr Ptr DeviceTun -> Ptr DeviceTun -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr DeviceTun
forall a. Ptr a
FP.nullPtr
        then DeviceTun -> Maybe DeviceTun
forall a. a -> Maybe a
P.Just (DeviceTun -> Maybe DeviceTun)
-> IO DeviceTun -> IO (Maybe DeviceTun)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr DeviceTun -> DeviceTun)
-> Ptr DeviceTun -> IO DeviceTun
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DeviceTun -> DeviceTun
DeviceTun Ptr DeviceTun
ptr
        else Maybe DeviceTun -> IO (Maybe DeviceTun)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DeviceTun
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveDeviceTunMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveDeviceTunMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDeviceTunMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDeviceTunMethod "connectionCompatible" o = NM.Device.DeviceConnectionCompatibleMethodInfo
    ResolveDeviceTunMethod "connectionValid" o = NM.Device.DeviceConnectionValidMethodInfo
    ResolveDeviceTunMethod "delete" o = NM.Device.DeviceDeleteMethodInfo
    ResolveDeviceTunMethod "deleteAsync" o = NM.Device.DeviceDeleteAsyncMethodInfo
    ResolveDeviceTunMethod "deleteFinish" o = NM.Device.DeviceDeleteFinishMethodInfo
    ResolveDeviceTunMethod "disconnect" o = NM.Device.DeviceDisconnectMethodInfo
    ResolveDeviceTunMethod "disconnectAsync" o = NM.Device.DeviceDisconnectAsyncMethodInfo
    ResolveDeviceTunMethod "disconnectFinish" o = NM.Device.DeviceDisconnectFinishMethodInfo
    ResolveDeviceTunMethod "filterConnections" o = NM.Device.DeviceFilterConnectionsMethodInfo
    ResolveDeviceTunMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDeviceTunMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDeviceTunMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDeviceTunMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDeviceTunMethod "isReal" o = NM.Device.DeviceIsRealMethodInfo
    ResolveDeviceTunMethod "isSoftware" o = NM.Device.DeviceIsSoftwareMethodInfo
    ResolveDeviceTunMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDeviceTunMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDeviceTunMethod "reapply" o = NM.Device.DeviceReapplyMethodInfo
    ResolveDeviceTunMethod "reapplyAsync" o = NM.Device.DeviceReapplyAsyncMethodInfo
    ResolveDeviceTunMethod "reapplyFinish" o = NM.Device.DeviceReapplyFinishMethodInfo
    ResolveDeviceTunMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDeviceTunMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDeviceTunMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDeviceTunMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDeviceTunMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDeviceTunMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDeviceTunMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDeviceTunMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDeviceTunMethod "getActiveConnection" o = NM.Device.DeviceGetActiveConnectionMethodInfo
    ResolveDeviceTunMethod "getAppliedConnection" o = NM.Device.DeviceGetAppliedConnectionMethodInfo
    ResolveDeviceTunMethod "getAppliedConnectionAsync" o = NM.Device.DeviceGetAppliedConnectionAsyncMethodInfo
    ResolveDeviceTunMethod "getAppliedConnectionFinish" o = NM.Device.DeviceGetAppliedConnectionFinishMethodInfo
    ResolveDeviceTunMethod "getAutoconnect" o = NM.Device.DeviceGetAutoconnectMethodInfo
    ResolveDeviceTunMethod "getAvailableConnections" o = NM.Device.DeviceGetAvailableConnectionsMethodInfo
    ResolveDeviceTunMethod "getCapabilities" o = NM.Device.DeviceGetCapabilitiesMethodInfo
    ResolveDeviceTunMethod "getClient" o = NM.Object.ObjectGetClientMethodInfo
    ResolveDeviceTunMethod "getConnectivity" o = NM.Device.DeviceGetConnectivityMethodInfo
    ResolveDeviceTunMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDeviceTunMethod "getDescription" o = NM.Device.DeviceGetDescriptionMethodInfo
    ResolveDeviceTunMethod "getDeviceType" o = NM.Device.DeviceGetDeviceTypeMethodInfo
    ResolveDeviceTunMethod "getDhcp4Config" o = NM.Device.DeviceGetDhcp4ConfigMethodInfo
    ResolveDeviceTunMethod "getDhcp6Config" o = NM.Device.DeviceGetDhcp6ConfigMethodInfo
    ResolveDeviceTunMethod "getDriver" o = NM.Device.DeviceGetDriverMethodInfo
    ResolveDeviceTunMethod "getDriverVersion" o = NM.Device.DeviceGetDriverVersionMethodInfo
    ResolveDeviceTunMethod "getFirmwareMissing" o = NM.Device.DeviceGetFirmwareMissingMethodInfo
    ResolveDeviceTunMethod "getFirmwareVersion" o = NM.Device.DeviceGetFirmwareVersionMethodInfo
    ResolveDeviceTunMethod "getGroup" o = DeviceTunGetGroupMethodInfo
    ResolveDeviceTunMethod "getHwAddress" o = NM.Device.DeviceGetHwAddressMethodInfo
    ResolveDeviceTunMethod "getIface" o = NM.Device.DeviceGetIfaceMethodInfo
    ResolveDeviceTunMethod "getInterfaceFlags" o = NM.Device.DeviceGetInterfaceFlagsMethodInfo
    ResolveDeviceTunMethod "getIp4Config" o = NM.Device.DeviceGetIp4ConfigMethodInfo
    ResolveDeviceTunMethod "getIp6Config" o = NM.Device.DeviceGetIp6ConfigMethodInfo
    ResolveDeviceTunMethod "getIpIface" o = NM.Device.DeviceGetIpIfaceMethodInfo
    ResolveDeviceTunMethod "getLldpNeighbors" o = NM.Device.DeviceGetLldpNeighborsMethodInfo
    ResolveDeviceTunMethod "getManaged" o = NM.Device.DeviceGetManagedMethodInfo
    ResolveDeviceTunMethod "getMetered" o = NM.Device.DeviceGetMeteredMethodInfo
    ResolveDeviceTunMethod "getMode" o = DeviceTunGetModeMethodInfo
    ResolveDeviceTunMethod "getMtu" o = NM.Device.DeviceGetMtuMethodInfo
    ResolveDeviceTunMethod "getMultiQueue" o = DeviceTunGetMultiQueueMethodInfo
    ResolveDeviceTunMethod "getNmPluginMissing" o = NM.Device.DeviceGetNmPluginMissingMethodInfo
    ResolveDeviceTunMethod "getNoPi" o = DeviceTunGetNoPiMethodInfo
    ResolveDeviceTunMethod "getOwner" o = DeviceTunGetOwnerMethodInfo
    ResolveDeviceTunMethod "getPath" o = NM.Device.DeviceGetPathMethodInfo
    ResolveDeviceTunMethod "getPhysicalPortId" o = NM.Device.DeviceGetPhysicalPortIdMethodInfo
    ResolveDeviceTunMethod "getPorts" o = NM.Device.DeviceGetPortsMethodInfo
    ResolveDeviceTunMethod "getProduct" o = NM.Device.DeviceGetProductMethodInfo
    ResolveDeviceTunMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDeviceTunMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDeviceTunMethod "getSettingType" o = NM.Device.DeviceGetSettingTypeMethodInfo
    ResolveDeviceTunMethod "getState" o = NM.Device.DeviceGetStateMethodInfo
    ResolveDeviceTunMethod "getStateReason" o = NM.Device.DeviceGetStateReasonMethodInfo
    ResolveDeviceTunMethod "getTypeDescription" o = NM.Device.DeviceGetTypeDescriptionMethodInfo
    ResolveDeviceTunMethod "getUdi" o = NM.Device.DeviceGetUdiMethodInfo
    ResolveDeviceTunMethod "getVendor" o = NM.Device.DeviceGetVendorMethodInfo
    ResolveDeviceTunMethod "getVnetHdr" o = DeviceTunGetVnetHdrMethodInfo
    ResolveDeviceTunMethod "setAutoconnect" o = NM.Device.DeviceSetAutoconnectMethodInfo
    ResolveDeviceTunMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDeviceTunMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDeviceTunMethod "setManaged" o = NM.Device.DeviceSetManagedMethodInfo
    ResolveDeviceTunMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDeviceTunMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDeviceTunMethod t DeviceTun, O.OverloadedMethod info DeviceTun p) => OL.IsLabel t (DeviceTun -> 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 ~ ResolveDeviceTunMethod t DeviceTun, O.OverloadedMethod info DeviceTun p, R.HasField t DeviceTun p) => R.HasField t DeviceTun p where
    getField = O.overloadedMethod @info

#endif

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

#endif

--- XXX Duplicated object with different types:
  --- Name {namespace = "NM", name = "Device"} -> Property {propName = "path", propType = TBasicType TUTF8, propFlags = [PropertyReadable], propReadNullable = Just False, propWriteNullable = Nothing, propSetter = Nothing, propGetter = Just "get_path", propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The device path as exposed by the udev property ID_PATH.\n\nThe string is backslash escaped (C escaping) for invalid\ncharacters. The escaping can be reverted with g_strcompress(),\nhowever the result may not be valid UTF-8.", sinceVersion = Just "1.26"}, propDeprecated = Nothing}
  --- Name {namespace = "NM", name = "Object"} -> Property {propName = "path", propType = TBasicType TUTF8, propFlags = [PropertyReadable], propReadNullable = Just False, propWriteNullable = Nothing, propSetter = Nothing, propGetter = Just "get_path", propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The D-Bus object path.\n\nThe D-Bus path of an object instance never changes, even if the object\ngets removed from the cache. To see whether the object is still in the\ncache, check NMObject:client.", sinceVersion = Nothing}, propDeprecated = Nothing}
-- VVV Prop "group"
   -- Type: TBasicType TInt64
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

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

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

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

-- | Get the value of the “@mode@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' deviceTun #mode
-- @
getDeviceTunMode :: (MonadIO m, IsDeviceTun o) => o -> m T.Text
getDeviceTunMode :: forall (m :: * -> *) o. (MonadIO m, IsDeviceTun o) => o -> m Text
getDeviceTunMode o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDeviceTunMode" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO 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
"mode"

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

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

-- | Get the value of the “@multi-queue@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' deviceTun #multiQueue
-- @
getDeviceTunMultiQueue :: (MonadIO m, IsDeviceTun o) => o -> m Bool
getDeviceTunMultiQueue :: forall (m :: * -> *) o. (MonadIO m, IsDeviceTun o) => o -> m Bool
getDeviceTunMultiQueue 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
"multi-queue"

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

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

-- | Get the value of the “@no-pi@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' deviceTun #noPi
-- @
getDeviceTunNoPi :: (MonadIO m, IsDeviceTun o) => o -> m Bool
getDeviceTunNoPi :: forall (m :: * -> *) o. (MonadIO m, IsDeviceTun o) => o -> m Bool
getDeviceTunNoPi 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
"no-pi"

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

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

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

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

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

-- | Get the value of the “@vnet-hdr@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' deviceTun #vnetHdr
-- @
getDeviceTunVnetHdr :: (MonadIO m, IsDeviceTun o) => o -> m Bool
getDeviceTunVnetHdr :: forall (m :: * -> *) o. (MonadIO m, IsDeviceTun o) => o -> m Bool
getDeviceTunVnetHdr 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
"vnet-hdr"

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

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DeviceTun
type instance O.AttributeList DeviceTun = DeviceTunAttributeList
type DeviceTunAttributeList = ('[ '("activeConnection", NM.Device.DeviceActiveConnectionPropertyInfo), '("autoconnect", NM.Device.DeviceAutoconnectPropertyInfo), '("availableConnections", NM.Device.DeviceAvailableConnectionsPropertyInfo), '("capabilities", NM.Device.DeviceCapabilitiesPropertyInfo), '("client", NM.Object.ObjectClientPropertyInfo), '("deviceType", NM.Device.DeviceDeviceTypePropertyInfo), '("dhcp4Config", NM.Device.DeviceDhcp4ConfigPropertyInfo), '("dhcp6Config", NM.Device.DeviceDhcp6ConfigPropertyInfo), '("driver", NM.Device.DeviceDriverPropertyInfo), '("driverVersion", NM.Device.DeviceDriverVersionPropertyInfo), '("firmwareMissing", NM.Device.DeviceFirmwareMissingPropertyInfo), '("firmwareVersion", NM.Device.DeviceFirmwareVersionPropertyInfo), '("group", DeviceTunGroupPropertyInfo), '("hwAddress", NM.Device.DeviceHwAddressPropertyInfo), '("interface", NM.Device.DeviceInterfacePropertyInfo), '("interfaceFlags", NM.Device.DeviceInterfaceFlagsPropertyInfo), '("ipInterface", NM.Device.DeviceIpInterfacePropertyInfo), '("ip4Config", NM.Device.DeviceIp4ConfigPropertyInfo), '("ip4Connectivity", NM.Device.DeviceIp4ConnectivityPropertyInfo), '("ip6Config", NM.Device.DeviceIp6ConfigPropertyInfo), '("ip6Connectivity", NM.Device.DeviceIp6ConnectivityPropertyInfo), '("lldpNeighbors", NM.Device.DeviceLldpNeighborsPropertyInfo), '("managed", NM.Device.DeviceManagedPropertyInfo), '("metered", NM.Device.DeviceMeteredPropertyInfo), '("mode", DeviceTunModePropertyInfo), '("mtu", NM.Device.DeviceMtuPropertyInfo), '("multiQueue", DeviceTunMultiQueuePropertyInfo), '("nmPluginMissing", NM.Device.DeviceNmPluginMissingPropertyInfo), '("noPi", DeviceTunNoPiPropertyInfo), '("owner", DeviceTunOwnerPropertyInfo), '("path", NM.Device.DevicePathPropertyInfo), '("physicalPortId", NM.Device.DevicePhysicalPortIdPropertyInfo), '("ports", NM.Device.DevicePortsPropertyInfo), '("product", NM.Device.DeviceProductPropertyInfo), '("real", NM.Device.DeviceRealPropertyInfo), '("state", NM.Device.DeviceStatePropertyInfo), '("stateReason", NM.Device.DeviceStateReasonPropertyInfo), '("udi", NM.Device.DeviceUdiPropertyInfo), '("vendor", NM.Device.DeviceVendorPropertyInfo), '("vnetHdr", DeviceTunVnetHdrPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
deviceTunGroup :: AttrLabelProxy "group"
deviceTunGroup = AttrLabelProxy

deviceTunMode :: AttrLabelProxy "mode"
deviceTunMode = AttrLabelProxy

deviceTunMultiQueue :: AttrLabelProxy "multiQueue"
deviceTunMultiQueue = AttrLabelProxy

deviceTunNoPi :: AttrLabelProxy "noPi"
deviceTunNoPi = AttrLabelProxy

deviceTunOwner :: AttrLabelProxy "owner"
deviceTunOwner = AttrLabelProxy

deviceTunVnetHdr :: AttrLabelProxy "vnetHdr"
deviceTunVnetHdr = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DeviceTun = DeviceTunSignalList
type DeviceTunSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("stateChanged", NM.Device.DeviceStateChangedSignalInfo)] :: [(Symbol, DK.Type)])

#endif

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

foreign import ccall "nm_device_tun_get_group" nm_device_tun_get_group :: 
    Ptr DeviceTun ->                        -- device : TInterface (Name {namespace = "NM", name = "DeviceTun"})
    IO Int64

-- | Gets the tunnel group.
-- 
-- /Since: 1.2/
deviceTunGetGroup ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceTun a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceTun.DeviceTun'
    -> m Int64
    -- ^ __Returns:__ the gid of the tunnel group, or -1 if it has no owner.
deviceTunGetGroup :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceTun a) =>
a -> m Int64
deviceTunGetGroup a
device = IO Int64 -> m Int64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceTun
device' <- a -> IO (Ptr DeviceTun)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Int64
result <- Ptr DeviceTun -> IO Int64
nm_device_tun_get_group Ptr DeviceTun
device'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    Int64 -> IO Int64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result

#if defined(ENABLE_OVERLOADING)
data DeviceTunGetGroupMethodInfo
instance (signature ~ (m Int64), MonadIO m, IsDeviceTun a) => O.OverloadedMethod DeviceTunGetGroupMethodInfo a signature where
    overloadedMethod = deviceTunGetGroup

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


#endif

-- method DeviceTun::get_mode
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceTun" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceTun" , 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_device_tun_get_mode" nm_device_tun_get_mode :: 
    Ptr DeviceTun ->                        -- device : TInterface (Name {namespace = "NM", name = "DeviceTun"})
    IO CString

-- | Returns the TUN\/TAP mode for the device.
-- 
-- /Since: 1.2/
deviceTunGetMode ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceTun a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceTun.DeviceTun'
    -> m T.Text
    -- ^ __Returns:__ \'tun\' or \'tap\'
deviceTunGetMode :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceTun a) =>
a -> m Text
deviceTunGetMode a
device = 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 DeviceTun
device' <- a -> IO (Ptr DeviceTun)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    CString
result <- Ptr DeviceTun -> IO CString
nm_device_tun_get_mode Ptr DeviceTun
device'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceTunGetMode" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DeviceTunGetModeMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDeviceTun a) => O.OverloadedMethod DeviceTunGetModeMethodInfo a signature where
    overloadedMethod = deviceTunGetMode

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


#endif

-- method DeviceTun::get_multi_queue
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceTun" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceTun" , 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_device_tun_get_multi_queue" nm_device_tun_get_multi_queue :: 
    Ptr DeviceTun ->                        -- device : TInterface (Name {namespace = "NM", name = "DeviceTun"})
    IO CInt

-- | Returns whether the t'GI.NM.Objects.DeviceTun.DeviceTun' has the IFF_MULTI_QUEUE flag.
-- 
-- /Since: 1.2/
deviceTunGetMultiQueue ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceTun a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceTun.DeviceTun'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the device doesn\'t have the flag, 'P.False' otherwise
deviceTunGetMultiQueue :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceTun a) =>
a -> m Bool
deviceTunGetMultiQueue a
device = 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 DeviceTun
device' <- a -> IO (Ptr DeviceTun)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    CInt
result <- Ptr DeviceTun -> IO CInt
nm_device_tun_get_multi_queue Ptr DeviceTun
device'
    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
device
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DeviceTunGetMultiQueueMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeviceTun a) => O.OverloadedMethod DeviceTunGetMultiQueueMethodInfo a signature where
    overloadedMethod = deviceTunGetMultiQueue

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


#endif

-- method DeviceTun::get_no_pi
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceTun" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceTun" , 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_device_tun_get_no_pi" nm_device_tun_get_no_pi :: 
    Ptr DeviceTun ->                        -- device : TInterface (Name {namespace = "NM", name = "DeviceTun"})
    IO CInt

-- | Returns whether the t'GI.NM.Objects.DeviceTun.DeviceTun' has the IFF_NO_PI flag.
-- 
-- /Since: 1.2/
deviceTunGetNoPi ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceTun a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceTun.DeviceTun'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the device has the flag, 'P.False' otherwise
deviceTunGetNoPi :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceTun a) =>
a -> m Bool
deviceTunGetNoPi a
device = 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 DeviceTun
device' <- a -> IO (Ptr DeviceTun)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    CInt
result <- Ptr DeviceTun -> IO CInt
nm_device_tun_get_no_pi Ptr DeviceTun
device'
    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
device
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DeviceTunGetNoPiMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeviceTun a) => O.OverloadedMethod DeviceTunGetNoPiMethodInfo a signature where
    overloadedMethod = deviceTunGetNoPi

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


#endif

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

foreign import ccall "nm_device_tun_get_owner" nm_device_tun_get_owner :: 
    Ptr DeviceTun ->                        -- device : TInterface (Name {namespace = "NM", name = "DeviceTun"})
    IO Int64

-- | Gets the tunnel owner.
-- 
-- /Since: 1.2/
deviceTunGetOwner ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceTun a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceTun.DeviceTun'
    -> m Int64
    -- ^ __Returns:__ the uid of the tunnel owner, or -1 if it has no owner.
deviceTunGetOwner :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceTun a) =>
a -> m Int64
deviceTunGetOwner a
device = IO Int64 -> m Int64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceTun
device' <- a -> IO (Ptr DeviceTun)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Int64
result <- Ptr DeviceTun -> IO Int64
nm_device_tun_get_owner Ptr DeviceTun
device'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    Int64 -> IO Int64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result

#if defined(ENABLE_OVERLOADING)
data DeviceTunGetOwnerMethodInfo
instance (signature ~ (m Int64), MonadIO m, IsDeviceTun a) => O.OverloadedMethod DeviceTunGetOwnerMethodInfo a signature where
    overloadedMethod = deviceTunGetOwner

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


#endif

-- method DeviceTun::get_vnet_hdr
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceTun" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceTun" , 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_device_tun_get_vnet_hdr" nm_device_tun_get_vnet_hdr :: 
    Ptr DeviceTun ->                        -- device : TInterface (Name {namespace = "NM", name = "DeviceTun"})
    IO CInt

-- | Returns whether the t'GI.NM.Objects.DeviceTun.DeviceTun' has the IFF_VNET_HDR flag.
-- 
-- /Since: 1.2/
deviceTunGetVnetHdr ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceTun a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceTun.DeviceTun'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the device has the flag, 'P.False' otherwise
deviceTunGetVnetHdr :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceTun a) =>
a -> m Bool
deviceTunGetVnetHdr a
device = 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 DeviceTun
device' <- a -> IO (Ptr DeviceTun)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    CInt
result <- Ptr DeviceTun -> IO CInt
nm_device_tun_get_vnet_hdr Ptr DeviceTun
device'
    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
device
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DeviceTunGetVnetHdrMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDeviceTun a) => O.OverloadedMethod DeviceTunGetVnetHdrMethodInfo a signature where
    overloadedMethod = deviceTunGetVnetHdr

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


#endif