{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Veth Settings

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

module GI.NM.Objects.SettingVeth
    ( 

-- * Exported types
    SettingVeth(..)                         ,
    IsSettingVeth                           ,
    toSettingVeth                           ,


 -- * 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"), [compare]("GI.NM.Objects.Setting#g:method:compare"), [diff]("GI.NM.Objects.Setting#g:method:diff"), [duplicate]("GI.NM.Objects.Setting#g:method:duplicate"), [enumerateValues]("GI.NM.Objects.Setting#g:method:enumerateValues"), [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"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [optionClearByName]("GI.NM.Objects.Setting#g:method:optionClearByName"), [optionGet]("GI.NM.Objects.Setting#g:method:optionGet"), [optionGetAllNames]("GI.NM.Objects.Setting#g:method:optionGetAllNames"), [optionGetBoolean]("GI.NM.Objects.Setting#g:method:optionGetBoolean"), [optionGetUint32]("GI.NM.Objects.Setting#g:method:optionGetUint32"), [optionSet]("GI.NM.Objects.Setting#g:method:optionSet"), [optionSetBoolean]("GI.NM.Objects.Setting#g:method:optionSetBoolean"), [optionSetUint32]("GI.NM.Objects.Setting#g:method:optionSetUint32"), [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"), [toString]("GI.NM.Objects.Setting#g:method:toString"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [verify]("GI.NM.Objects.Setting#g:method:verify"), [verifySecrets]("GI.NM.Objects.Setting#g:method:verifySecrets"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDbusPropertyType]("GI.NM.Objects.Setting#g:method:getDbusPropertyType"), [getName]("GI.NM.Objects.Setting#g:method:getName"), [getPeer]("GI.NM.Objects.SettingVeth#g:method:getPeer"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSecretFlags]("GI.NM.Objects.Setting#g:method:getSecretFlags").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSecretFlags]("GI.NM.Objects.Setting#g:method:setSecretFlags").

#if defined(ENABLE_OVERLOADING)
    ResolveSettingVethMethod                ,
#endif

-- ** getPeer #method:getPeer#

#if defined(ENABLE_OVERLOADING)
    SettingVethGetPeerMethodInfo            ,
#endif
    settingVethGetPeer                      ,


-- ** new #method:new#

    settingVethNew                          ,




 -- * Properties


-- ** peer #attr:peer#
-- | This property specifies the peer interface name of the veth. This
-- property is mandatory.
-- 
-- /Since: 1.30/

#if defined(ENABLE_OVERLOADING)
    SettingVethPeerPropertyInfo             ,
#endif
    clearSettingVethPeer                    ,
    constructSettingVethPeer                ,
    getSettingVethPeer                      ,
    setSettingVethPeer                      ,
#if defined(ENABLE_OVERLOADING)
    settingVethPeer                         ,
#endif




    ) where

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

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

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

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.NM.Objects.Setting as NM.Setting

#endif

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

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

foreign import ccall "nm_setting_veth_get_type"
    c_nm_setting_veth_get_type :: IO B.Types.GType

instance B.Types.TypedObject SettingVeth where
    glibType :: IO GType
glibType = IO GType
c_nm_setting_veth_get_type

instance B.Types.GObject SettingVeth

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

instance O.HasParentTypes SettingVeth
type instance O.ParentTypes SettingVeth = '[NM.Setting.Setting, GObject.Object.Object]

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveSettingVethMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSettingVethMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSettingVethMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSettingVethMethod "compare" o = NM.Setting.SettingCompareMethodInfo
    ResolveSettingVethMethod "diff" o = NM.Setting.SettingDiffMethodInfo
    ResolveSettingVethMethod "duplicate" o = NM.Setting.SettingDuplicateMethodInfo
    ResolveSettingVethMethod "enumerateValues" o = NM.Setting.SettingEnumerateValuesMethodInfo
    ResolveSettingVethMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSettingVethMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSettingVethMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSettingVethMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSettingVethMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSettingVethMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSettingVethMethod "optionClearByName" o = NM.Setting.SettingOptionClearByNameMethodInfo
    ResolveSettingVethMethod "optionGet" o = NM.Setting.SettingOptionGetMethodInfo
    ResolveSettingVethMethod "optionGetAllNames" o = NM.Setting.SettingOptionGetAllNamesMethodInfo
    ResolveSettingVethMethod "optionGetBoolean" o = NM.Setting.SettingOptionGetBooleanMethodInfo
    ResolveSettingVethMethod "optionGetUint32" o = NM.Setting.SettingOptionGetUint32MethodInfo
    ResolveSettingVethMethod "optionSet" o = NM.Setting.SettingOptionSetMethodInfo
    ResolveSettingVethMethod "optionSetBoolean" o = NM.Setting.SettingOptionSetBooleanMethodInfo
    ResolveSettingVethMethod "optionSetUint32" o = NM.Setting.SettingOptionSetUint32MethodInfo
    ResolveSettingVethMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSettingVethMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSettingVethMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSettingVethMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSettingVethMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSettingVethMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSettingVethMethod "toString" o = NM.Setting.SettingToStringMethodInfo
    ResolveSettingVethMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSettingVethMethod "verify" o = NM.Setting.SettingVerifyMethodInfo
    ResolveSettingVethMethod "verifySecrets" o = NM.Setting.SettingVerifySecretsMethodInfo
    ResolveSettingVethMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSettingVethMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSettingVethMethod "getDbusPropertyType" o = NM.Setting.SettingGetDbusPropertyTypeMethodInfo
    ResolveSettingVethMethod "getName" o = NM.Setting.SettingGetNameMethodInfo
    ResolveSettingVethMethod "getPeer" o = SettingVethGetPeerMethodInfo
    ResolveSettingVethMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSettingVethMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSettingVethMethod "getSecretFlags" o = NM.Setting.SettingGetSecretFlagsMethodInfo
    ResolveSettingVethMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSettingVethMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSettingVethMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSettingVethMethod "setSecretFlags" o = NM.Setting.SettingSetSecretFlagsMethodInfo
    ResolveSettingVethMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

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

-- | Get the value of the “@peer@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' settingVeth #peer
-- @
getSettingVethPeer :: (MonadIO m, IsSettingVeth o) => o -> m T.Text
getSettingVethPeer :: forall (m :: * -> *) o. (MonadIO m, IsSettingVeth o) => o -> m Text
getSettingVethPeer 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
"getSettingVethPeer" (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
"peer"

-- | Set the value of the “@peer@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' settingVeth [ #peer 'Data.GI.Base.Attributes.:=' value ]
-- @
setSettingVethPeer :: (MonadIO m, IsSettingVeth o) => o -> T.Text -> m ()
setSettingVethPeer :: forall (m :: * -> *) o.
(MonadIO m, IsSettingVeth o) =>
o -> Text -> m ()
setSettingVethPeer o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"peer" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

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

-- | Set the value of the “@peer@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #peer
-- @
clearSettingVethPeer :: (MonadIO m, IsSettingVeth o) => o -> m ()
clearSettingVethPeer :: forall (m :: * -> *) o. (MonadIO m, IsSettingVeth o) => o -> m ()
clearSettingVethPeer o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"peer" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

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

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SettingVeth
type instance O.AttributeList SettingVeth = SettingVethAttributeList
type SettingVethAttributeList = ('[ '("name", NM.Setting.SettingNamePropertyInfo), '("peer", SettingVethPeerPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
settingVethPeer :: AttrLabelProxy "peer"
settingVethPeer = AttrLabelProxy

#endif

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

#endif

-- method SettingVeth::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "NM" , name = "SettingVeth" })
-- throws : False
-- Skip return : False

foreign import ccall "nm_setting_veth_new" nm_setting_veth_new :: 
    IO (Ptr SettingVeth)

-- | Creates a new t'GI.NM.Objects.SettingVeth.SettingVeth' object with default values.
-- 
-- /Since: 1.30/
settingVethNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m SettingVeth
    -- ^ __Returns:__ the new empty t'GI.NM.Objects.SettingVeth.SettingVeth' object
settingVethNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SettingVeth
settingVethNew  = IO SettingVeth -> m SettingVeth
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SettingVeth -> m SettingVeth)
-> IO SettingVeth -> m SettingVeth
forall a b. (a -> b) -> a -> b
$ do
    Ptr SettingVeth
result <- IO (Ptr SettingVeth)
nm_setting_veth_new
    Text -> Ptr SettingVeth -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingVethNew" Ptr SettingVeth
result
    SettingVeth
result' <- ((ManagedPtr SettingVeth -> SettingVeth)
-> Ptr SettingVeth -> IO SettingVeth
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SettingVeth -> SettingVeth
SettingVeth) Ptr SettingVeth
result
    SettingVeth -> IO SettingVeth
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SettingVeth
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SettingVeth::get_peer
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "setting"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SettingVeth" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSettingVeth" , 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_setting_veth_get_peer" nm_setting_veth_get_peer :: 
    Ptr SettingVeth ->                      -- setting : TInterface (Name {namespace = "NM", name = "SettingVeth"})
    IO CString

-- | /No description available in the introspection data./
-- 
-- /Since: 1.30/
settingVethGetPeer ::
    (B.CallStack.HasCallStack, MonadIO m, IsSettingVeth a) =>
    a
    -- ^ /@setting@/: the t'GI.NM.Objects.SettingVeth.SettingVeth'
    -> m T.Text
    -- ^ __Returns:__ the [SettingVeth:peer]("GI.NM.Objects.SettingVeth#g:attr:peer") property of the setting
settingVethGetPeer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingVeth a) =>
a -> m Text
settingVethGetPeer a
setting = 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 SettingVeth
setting' <- a -> IO (Ptr SettingVeth)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
    CString
result <- Ptr SettingVeth -> IO CString
nm_setting_veth_get_peer Ptr SettingVeth
setting'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingVethGetPeer" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data SettingVethGetPeerMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSettingVeth a) => O.OverloadedMethod SettingVethGetPeerMethodInfo a signature where
    overloadedMethod = settingVethGetPeer

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


#endif