{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Ethtool Ethernet Settings
-- 
-- /Since: 1.14/

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

module GI.NM.Objects.SettingEthtool
    ( 

-- * Exported types
    SettingEthtool(..)                      ,
    IsSettingEthtool                        ,
    toSettingEthtool                        ,


 -- * 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"), [clearFeatures]("GI.NM.Objects.SettingEthtool#g:method:clearFeatures"), [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"), [getFeature]("GI.NM.Objects.SettingEthtool#g:method:getFeature"), [getName]("GI.NM.Objects.Setting#g:method:getName"), [getOptnames]("GI.NM.Objects.SettingEthtool#g:method:getOptnames"), [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"), [setFeature]("GI.NM.Objects.SettingEthtool#g:method:setFeature"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSecretFlags]("GI.NM.Objects.Setting#g:method:setSecretFlags").

#if defined(ENABLE_OVERLOADING)
    ResolveSettingEthtoolMethod             ,
#endif

-- ** clearFeatures #method:clearFeatures#

#if defined(ENABLE_OVERLOADING)
    SettingEthtoolClearFeaturesMethodInfo   ,
#endif
    settingEthtoolClearFeatures             ,


-- ** getFeature #method:getFeature#

#if defined(ENABLE_OVERLOADING)
    SettingEthtoolGetFeatureMethodInfo      ,
#endif
    settingEthtoolGetFeature                ,


-- ** getOptnames #method:getOptnames#

#if defined(ENABLE_OVERLOADING)
    SettingEthtoolGetOptnamesMethodInfo     ,
#endif
    settingEthtoolGetOptnames               ,


-- ** new #method:new#

    settingEthtoolNew                       ,


-- ** setFeature #method:setFeature#

#if defined(ENABLE_OVERLOADING)
    SettingEthtoolSetFeatureMethodInfo      ,
#endif
    settingEthtoolSetFeature                ,




    ) 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.Enums as NM.Enums
import {-# SOURCE #-} qualified GI.NM.Objects.Setting as NM.Setting

#endif

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

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

foreign import ccall "nm_setting_ethtool_get_type"
    c_nm_setting_ethtool_get_type :: IO B.Types.GType

instance B.Types.TypedObject SettingEthtool where
    glibType :: IO GType
glibType = IO GType
c_nm_setting_ethtool_get_type

instance B.Types.GObject SettingEthtool

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

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

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

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

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

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

#endif

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

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

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

foreign import ccall "nm_setting_ethtool_new" nm_setting_ethtool_new :: 
    IO (Ptr SettingEthtool)

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

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "nm_setting_ethtool_clear_features" nm_setting_ethtool_clear_features :: 
    Ptr SettingEthtool ->                   -- setting : TInterface (Name {namespace = "NM", name = "SettingEthtool"})
    IO ()

{-# DEPRECATED settingEthtoolClearFeatures ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionClearByName' with 'GI.NM.Functions.ethtoolOptnameIsFeature' predicate instead."] #-}
-- | Clears all offload features settings
-- 
-- /Since: 1.14/
settingEthtoolClearFeatures ::
    (B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
    a
    -- ^ /@setting@/: the t'GI.NM.Objects.SettingEthtool.SettingEthtool'
    -> m ()
settingEthtoolClearFeatures :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> m ()
settingEthtoolClearFeatures a
setting = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
    Ptr SettingEthtool -> IO ()
nm_setting_ethtool_clear_features Ptr SettingEthtool
setting'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SettingEthtoolClearFeaturesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolClearFeaturesMethodInfo a signature where
    overloadedMethod = settingEthtoolClearFeatures

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


#endif

-- method SettingEthtool::get_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "setting"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SettingEthtool" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSettingEthtool"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "optname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "option name of the offload feature to get"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "NM" , name = "Ternary" })
-- throws : False
-- Skip return : False

foreign import ccall "nm_setting_ethtool_get_feature" nm_setting_ethtool_get_feature :: 
    Ptr SettingEthtool ->                   -- setting : TInterface (Name {namespace = "NM", name = "SettingEthtool"})
    CString ->                              -- optname : TBasicType TUTF8
    IO CInt

{-# DEPRECATED settingEthtoolGetFeature ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionGetBoolean' instead."] #-}
-- | Gets and offload feature setting. Returns 'GI.NM.Enums.TernaryDefault' if the
-- feature is not set.
-- 
-- Note that /@optname@/ must be a valid name for a feature, according to
-- 'GI.NM.Functions.ethtoolOptnameIsFeature'.
-- 
-- /Since: 1.14/
settingEthtoolGetFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
    a
    -- ^ /@setting@/: the t'GI.NM.Objects.SettingEthtool.SettingEthtool'
    -> T.Text
    -- ^ /@optname@/: option name of the offload feature to get
    -> m NM.Enums.Ternary
    -- ^ __Returns:__ a t'GI.NM.Enums.Ternary' value indicating whether the offload feature
    --   is enabled, disabled, or left untouched.
settingEthtoolGetFeature :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> Text -> m Ternary
settingEthtoolGetFeature a
setting Text
optname = IO Ternary -> m Ternary
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Ternary -> m Ternary) -> IO Ternary -> m Ternary
forall a b. (a -> b) -> a -> b
$ do
    Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
    CString
optname' <- Text -> IO CString
textToCString Text
optname
    CInt
result <- Ptr SettingEthtool -> CString -> IO CInt
nm_setting_ethtool_get_feature Ptr SettingEthtool
setting' CString
optname'
    let result' :: Ternary
result' = (Int -> Ternary
forall a. Enum a => Int -> a
toEnum (Int -> Ternary) -> (CInt -> Int) -> CInt -> Ternary
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optname'
    Ternary -> IO Ternary
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ternary
result'

#if defined(ENABLE_OVERLOADING)
data SettingEthtoolGetFeatureMethodInfo
instance (signature ~ (T.Text -> m NM.Enums.Ternary), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolGetFeatureMethodInfo a signature where
    overloadedMethod = settingEthtoolGetFeature

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


#endif

-- method SettingEthtool::get_optnames
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "setting"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SettingEthtool" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSettingEthtool instance."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for the number of keys returned, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "nm_setting_ethtool_get_optnames" nm_setting_ethtool_get_optnames :: 
    Ptr SettingEthtool ->                   -- setting : TInterface (Name {namespace = "NM", name = "SettingEthtool"})
    Ptr Word32 ->                           -- out_length : TBasicType TUInt
    IO (Ptr CString)

{-# DEPRECATED settingEthtoolGetOptnames ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionGetAllNames' instead."] #-}
-- | This returns all options names that are set. This includes the feature names
-- like 'GI.NM.Constants.ETHTOOL_OPTNAME_FEATURE_GRO'. See 'GI.NM.Functions.ethtoolOptnameIsFeature' to
-- check whether the option name is valid for offload features.
-- 
-- /Since: 1.20/
settingEthtoolGetOptnames ::
    (B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
    a
    -- ^ /@setting@/: the t'GI.NM.Objects.SettingEthtool.SettingEthtool' instance.
    -> m (([T.Text], Word32))
    -- ^ __Returns:__ list of set option
    --   names or 'P.Nothing' if no options are set. The option names are still owned by
    --   /@setting@/ and may get invalidated when /@setting@/ gets modified.
settingEthtoolGetOptnames :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> m ([Text], Word32)
settingEthtoolGetOptnames a
setting = IO ([Text], Word32) -> m ([Text], Word32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ([Text], Word32) -> m ([Text], Word32))
-> IO ([Text], Word32) -> m ([Text], Word32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
    Ptr Word32
outLength <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr CString
result <- Ptr SettingEthtool -> Ptr Word32 -> IO (Ptr CString)
nm_setting_ethtool_get_optnames Ptr SettingEthtool
setting' Ptr Word32
outLength
    Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingEthtoolGetOptnames" Ptr CString
result
    [Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
    Word32
outLength' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outLength
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outLength
    ([Text], Word32) -> IO ([Text], Word32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Text]
result', Word32
outLength')

#if defined(ENABLE_OVERLOADING)
data SettingEthtoolGetOptnamesMethodInfo
instance (signature ~ (m (([T.Text], Word32))), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolGetOptnamesMethodInfo a signature where
    overloadedMethod = settingEthtoolGetOptnames

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


#endif

-- method SettingEthtool::set_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "setting"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SettingEthtool" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSettingEthtool"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "optname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "option name of the offload feature to get"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TInterface Name { namespace = "NM" , name = "Ternary" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the new value to set. The special value %NM_TERNARY_DEFAULT\n  means to clear the offload feature setting."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_setting_ethtool_set_feature" nm_setting_ethtool_set_feature :: 
    Ptr SettingEthtool ->                   -- setting : TInterface (Name {namespace = "NM", name = "SettingEthtool"})
    CString ->                              -- optname : TBasicType TUTF8
    CInt ->                                 -- value : TInterface (Name {namespace = "NM", name = "Ternary"})
    IO ()

{-# DEPRECATED settingEthtoolSetFeature ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionSet' or 'GI.NM.Objects.Setting.settingOptionSetBoolean' instead."] #-}
-- | Sets and offload feature setting.
-- 
-- Note that /@optname@/ must be a valid name for a feature, according to
-- 'GI.NM.Functions.ethtoolOptnameIsFeature'.
-- 
-- /Since: 1.14/
settingEthtoolSetFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
    a
    -- ^ /@setting@/: the t'GI.NM.Objects.SettingEthtool.SettingEthtool'
    -> T.Text
    -- ^ /@optname@/: option name of the offload feature to get
    -> NM.Enums.Ternary
    -- ^ /@value@/: the new value to set. The special value 'GI.NM.Enums.TernaryDefault'
    --   means to clear the offload feature setting.
    -> m ()
settingEthtoolSetFeature :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> Text -> Ternary -> m ()
settingEthtoolSetFeature a
setting Text
optname Ternary
value = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
    CString
optname' <- Text -> IO CString
textToCString Text
optname
    let value' :: CInt
value' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Ternary -> Int) -> Ternary -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ternary -> Int
forall a. Enum a => a -> Int
fromEnum) Ternary
value
    Ptr SettingEthtool -> CString -> CInt -> IO ()
nm_setting_ethtool_set_feature Ptr SettingEthtool
setting' CString
optname' CInt
value'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optname'
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SettingEthtoolSetFeatureMethodInfo
instance (signature ~ (T.Text -> NM.Enums.Ternary -> m ()), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolSetFeatureMethodInfo a signature where
    overloadedMethod = settingEthtoolSetFeature

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


#endif