{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- An interface for retrieving PipeWire port information from a session item. This information is used to create links in the nodes graph.

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

module GI.Wp.Interfaces.SiLinkable
    ( 

-- * Exported types
    SiLinkable(..)                          ,
    IsSiLinkable                            ,
    toSiLinkable                            ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [abortActivation]("GI.Wp.Objects.Object#g:method:abortActivation"), [activate]("GI.Wp.Objects.Object#g:method:activate"), [activateClosure]("GI.Wp.Objects.Object#g:method:activateClosure"), [activateFinish]("GI.Wp.Objects.Object#g:method:activateFinish"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [configure]("GI.Wp.Objects.SessionItem#g:method:configure"), [deactivate]("GI.Wp.Objects.Object#g:method:deactivate"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isConfigured]("GI.Wp.Objects.SessionItem#g:method:isConfigured"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [register]("GI.Wp.Objects.SessionItem#g:method:register"), [remove]("GI.Wp.Objects.SessionItem#g:method:remove"), [reset]("GI.Wp.Objects.SessionItem#g:method:reset"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [testActiveFeatures]("GI.Wp.Objects.Object#g:method:testActiveFeatures"), [testSupportedFeatures]("GI.Wp.Objects.Object#g:method:testSupportedFeatures"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [updateFeatures]("GI.Wp.Objects.Object#g:method:updateFeatures"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getAcquisition]("GI.Wp.Interfaces.SiLinkable#g:method:getAcquisition"), [getActiveFeatures]("GI.Wp.Objects.Object#g:method:getActiveFeatures"), [getAssociatedProxy]("GI.Wp.Objects.SessionItem#g:method:getAssociatedProxy"), [getAssociatedProxyId]("GI.Wp.Objects.SessionItem#g:method:getAssociatedProxyId"), [getCore]("GI.Wp.Objects.Object#g:method:getCore"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getId]("GI.Wp.Objects.Object#g:method:getId"), [getPorts]("GI.Wp.Interfaces.SiLinkable#g:method:getPorts"), [getProperties]("GI.Wp.Objects.SessionItem#g:method:getProperties"), [getProperty]("GI.Wp.Objects.SessionItem#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSupportedFeatures]("GI.Wp.Objects.Object#g:method:getSupportedFeatures").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperties]("GI.Wp.Objects.SessionItem#g:method:setProperties"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveSiLinkableMethod                 ,
#endif

-- ** getAcquisition #method:getAcquisition#

#if defined(ENABLE_OVERLOADING)
    SiLinkableGetAcquisitionMethodInfo      ,
#endif
    siLinkableGetAcquisition                ,


-- ** getPorts #method:getPorts#

#if defined(ENABLE_OVERLOADING)
    SiLinkableGetPortsMethodInfo            ,
#endif
    siLinkableGetPorts                      ,




    ) 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.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Wp.Callbacks as Wp.Callbacks
import {-# SOURCE #-} qualified GI.Wp.Enums as Wp.Enums
import {-# SOURCE #-} qualified GI.Wp.Flags as Wp.Flags
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiAcquisition as Wp.SiAcquisition
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiLink as Wp.SiLink
import {-# SOURCE #-} qualified GI.Wp.Objects.Conf as Wp.Conf
import {-# SOURCE #-} qualified GI.Wp.Objects.Core as Wp.Core
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.ObjectManager as Wp.ObjectManager
import {-# SOURCE #-} qualified GI.Wp.Objects.Proxy as Wp.Proxy
import {-# SOURCE #-} qualified GI.Wp.Objects.SessionItem as Wp.SessionItem
import {-# SOURCE #-} qualified GI.Wp.Structs.Iterator as Wp.Iterator
import {-# SOURCE #-} qualified GI.Wp.Structs.IteratorMethods as Wp.IteratorMethods
import {-# SOURCE #-} qualified GI.Wp.Structs.ObjectInterest as Wp.ObjectInterest
import {-# SOURCE #-} qualified GI.Wp.Structs.Properties as Wp.Properties
import {-# SOURCE #-} qualified GI.Wp.Structs.SpaJson as Wp.SpaJson

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiAcquisition as Wp.SiAcquisition
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.SessionItem as Wp.SessionItem

#endif

-- interface SiLinkable 
-- | Memory-managed wrapper type.
newtype SiLinkable = SiLinkable (SP.ManagedPtr SiLinkable)
    deriving (Eq)

instance SP.ManagedPtrNewtype SiLinkable where
    toManagedPtr (SiLinkable p) = p

foreign import ccall "wp_si_linkable_get_type"
    c_wp_si_linkable_get_type :: IO B.Types.GType

instance B.Types.TypedObject SiLinkable where
    glibType = c_wp_si_linkable_get_type

instance B.Types.GObject SiLinkable

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

instance O.HasParentTypes SiLinkable
type instance O.ParentTypes SiLinkable = '[Wp.SessionItem.SessionItem, Wp.Object.Object, GObject.Object.Object]

-- | Cast to t'SiLinkable', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
toSiLinkable :: (MIO.MonadIO m, IsSiLinkable o) => o -> m SiLinkable
toSiLinkable = MIO.liftIO . B.ManagedPtr.unsafeCastTo SiLinkable

-- | Convert t'SiLinkable' 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 SiLinkable) where
    gvalueGType_ = c_wp_si_linkable_get_type
    gvalueSet_ gv P.Nothing = B.GValue.set_object gv (FP.nullPtr :: FP.Ptr SiLinkable)
    gvalueSet_ gv (P.Just obj) = B.ManagedPtr.withManagedPtr obj (B.GValue.set_object gv)
    gvalueGet_ gv = do
        ptr <- B.GValue.get_object gv :: IO (FP.Ptr SiLinkable)
        if ptr /= FP.nullPtr
        then P.Just <$> B.ManagedPtr.newObject SiLinkable ptr
        else return P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SiLinkable
type instance O.AttributeList SiLinkable = SiLinkableAttributeList
type SiLinkableAttributeList = ('[ '("activeFeatures", Wp.Object.ObjectActiveFeaturesPropertyInfo), '("core", Wp.Object.ObjectCorePropertyInfo), '("id", Wp.Object.ObjectIdPropertyInfo), '("properties", Wp.SessionItem.SessionItemPropertiesPropertyInfo), '("supportedFeatures", Wp.Object.ObjectSupportedFeaturesPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSiLinkableMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSiLinkableMethod "abortActivation" o = Wp.Object.ObjectAbortActivationMethodInfo
    ResolveSiLinkableMethod "activate" o = Wp.Object.ObjectActivateMethodInfo
    ResolveSiLinkableMethod "activateClosure" o = Wp.Object.ObjectActivateClosureMethodInfo
    ResolveSiLinkableMethod "activateFinish" o = Wp.Object.ObjectActivateFinishMethodInfo
    ResolveSiLinkableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSiLinkableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSiLinkableMethod "configure" o = Wp.SessionItem.SessionItemConfigureMethodInfo
    ResolveSiLinkableMethod "deactivate" o = Wp.Object.ObjectDeactivateMethodInfo
    ResolveSiLinkableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSiLinkableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSiLinkableMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSiLinkableMethod "isConfigured" o = Wp.SessionItem.SessionItemIsConfiguredMethodInfo
    ResolveSiLinkableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSiLinkableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSiLinkableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSiLinkableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSiLinkableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSiLinkableMethod "register" o = Wp.SessionItem.SessionItemRegisterMethodInfo
    ResolveSiLinkableMethod "remove" o = Wp.SessionItem.SessionItemRemoveMethodInfo
    ResolveSiLinkableMethod "reset" o = Wp.SessionItem.SessionItemResetMethodInfo
    ResolveSiLinkableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSiLinkableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSiLinkableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSiLinkableMethod "testActiveFeatures" o = Wp.Object.ObjectTestActiveFeaturesMethodInfo
    ResolveSiLinkableMethod "testSupportedFeatures" o = Wp.Object.ObjectTestSupportedFeaturesMethodInfo
    ResolveSiLinkableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSiLinkableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSiLinkableMethod "updateFeatures" o = Wp.Object.ObjectUpdateFeaturesMethodInfo
    ResolveSiLinkableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSiLinkableMethod "getAcquisition" o = SiLinkableGetAcquisitionMethodInfo
    ResolveSiLinkableMethod "getActiveFeatures" o = Wp.Object.ObjectGetActiveFeaturesMethodInfo
    ResolveSiLinkableMethod "getAssociatedProxy" o = Wp.SessionItem.SessionItemGetAssociatedProxyMethodInfo
    ResolveSiLinkableMethod "getAssociatedProxyId" o = Wp.SessionItem.SessionItemGetAssociatedProxyIdMethodInfo
    ResolveSiLinkableMethod "getCore" o = Wp.Object.ObjectGetCoreMethodInfo
    ResolveSiLinkableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSiLinkableMethod "getId" o = Wp.Object.ObjectGetIdMethodInfo
    ResolveSiLinkableMethod "getPorts" o = SiLinkableGetPortsMethodInfo
    ResolveSiLinkableMethod "getProperties" o = Wp.SessionItem.SessionItemGetPropertiesMethodInfo
    ResolveSiLinkableMethod "getProperty" o = Wp.SessionItem.SessionItemGetPropertyMethodInfo
    ResolveSiLinkableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSiLinkableMethod "getSupportedFeatures" o = Wp.Object.ObjectGetSupportedFeaturesMethodInfo
    ResolveSiLinkableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSiLinkableMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSiLinkableMethod "setProperties" o = Wp.SessionItem.SessionItemSetPropertiesMethodInfo
    ResolveSiLinkableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSiLinkableMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- method SiLinkable::get_acquisition
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SiLinkable" }
--           , argCType = Just "WpSiLinkable*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Wp" , name = "SiAcquisition" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_si_linkable_get_acquisition" wp_si_linkable_get_acquisition :: 
    Ptr SiLinkable ->                       -- self : TInterface (Name {namespace = "Wp", name = "SiLinkable"})
    IO (Ptr Wp.SiAcquisition.SiAcquisition)

-- | Gets the acquisition interface associated with the item.
siLinkableGetAcquisition ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiLinkable a) =>
    a
    -- ^ /@self@/: the session item
    -> m (Maybe Wp.SiAcquisition.SiAcquisition)
    -- ^ __Returns:__ the acquisition interface associated with this item, or NULL if this item does not require acquiring items before linking them
siLinkableGetAcquisition self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_si_linkable_get_acquisition self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Wp.SiAcquisition.SiAcquisition) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data SiLinkableGetAcquisitionMethodInfo
instance (signature ~ (m (Maybe Wp.SiAcquisition.SiAcquisition)), MonadIO m, IsSiLinkable a) => O.OverloadedMethod SiLinkableGetAcquisitionMethodInfo a signature where
    overloadedMethod = siLinkableGetAcquisition

instance O.OverloadedMethodInfo SiLinkableGetAcquisitionMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Interfaces.SiLinkable.siLinkableGetAcquisition",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Interfaces-SiLinkable.html#v:siLinkableGetAcquisition"
        })


#endif

-- method SiLinkable::get_ports
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SiLinkable" }
--           , argCType = Just "WpSiLinkable*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "context"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an optional context for the ports"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just TVariant
-- throws : False
-- Skip return : False

foreign import ccall "wp_si_linkable_get_ports" wp_si_linkable_get_ports :: 
    Ptr SiLinkable ->                       -- self : TInterface (Name {namespace = "Wp", name = "SiLinkable"})
    CString ->                              -- context : TBasicType TUTF8
    IO (Ptr GVariant)

-- | This method returns a variant of type \"a(uuu)\", where each tuple in the array contains the following information:
-- 
-- 
-- 
-- * u: (guint32) node id
-- * u: (guint32) port id (the port must belong on the node specified above)
-- * u: (guint32) the audio channel (enum spa_audio_channel) that this port makes available, or 0 for non-audio content
-- 
-- 
-- The order in which ports appear in this array is important when no channel information is available. The link implementation should link the ports in the order they appear. This is normally a good enough substitute for channel matching.
-- The /@context@/ argument can be used to get different sets of ports from the item. The following well-known contexts are defined:
-- * NULL: get the standard ports to be linked
-- * \"monitor\": get the monitor ports
-- * \"control\": get the control port
-- * \"reverse\": get the reverse direction ports, if this item controls a filter node, which would have ports on both directions
-- 
-- 
-- Contexts other than NULL may only be used internally to ease the implementation of more complex item relationships. For example, a WpSessionItem that is in control of an input (sink) adapter node may implement WpSiLinkable where the NULL context will return the standard input ports and the \"monitor\" context will return the adapter\'s monitor ports. When linking this item to another item, the NULL context will always be used, but the item may internally spawn a secondary WpSessionItem that implements the \"monitor\" item. That secondary item may implement WpSiLinkable, chaining calls to the WpSiLinkable of the original item using the \"monitor\" context. This way, the monitor WpSessionItem does not need to share control of the underlying node; it only proxies calls to satisfy the API.
siLinkableGetPorts ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiLinkable a) =>
    a
    -- ^ /@self@/: the session item
    -> Maybe (T.Text)
    -- ^ /@context@/: an optional context for the ports
    -> m GVariant
    -- ^ __Returns:__ a GVariant containing information about the ports of this item
siLinkableGetPorts self context = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeContext <- case context of
        Nothing -> return FP.nullPtr
        Just jContext -> do
            jContext' <- textToCString jContext
            return jContext'
    result <- wp_si_linkable_get_ports self' maybeContext
    checkUnexpectedReturnNULL "siLinkableGetPorts" result
    result' <- B.GVariant.wrapGVariantPtr result
    touchManagedPtr self
    freeMem maybeContext
    return result'

#if defined(ENABLE_OVERLOADING)
data SiLinkableGetPortsMethodInfo
instance (signature ~ (Maybe (T.Text) -> m GVariant), MonadIO m, IsSiLinkable a) => O.OverloadedMethod SiLinkableGetPortsMethodInfo a signature where
    overloadedMethod = siLinkableGetPorts

instance O.OverloadedMethodInfo SiLinkableGetPortsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Interfaces.SiLinkable.siLinkableGetPorts",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Interfaces-SiLinkable.html#v:siLinkableGetPorts"
        })


#endif

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

#endif


