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

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

module GI.Soup.Objects.WebsocketExtension
    ( 

-- * Exported types
    WebsocketExtension(..)                  ,
    IsWebsocketExtension                    ,
    toWebsocketExtension                    ,


 -- * 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"), [configure]("GI.Soup.Objects.WebsocketExtension#g:method:configure"), [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"), [processIncomingMessage]("GI.Soup.Objects.WebsocketExtension#g:method:processIncomingMessage"), [processOutgoingMessage]("GI.Soup.Objects.WebsocketExtension#g:method:processOutgoingMessage"), [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
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getRequestParams]("GI.Soup.Objects.WebsocketExtension#g:method:getRequestParams"), [getResponseParams]("GI.Soup.Objects.WebsocketExtension#g:method:getResponseParams").
-- 
-- ==== 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").

#if defined(ENABLE_OVERLOADING)
    ResolveWebsocketExtensionMethod         ,
#endif

-- ** configure #method:configure#

#if defined(ENABLE_OVERLOADING)
    WebsocketExtensionConfigureMethodInfo   ,
#endif
    websocketExtensionConfigure             ,


-- ** getRequestParams #method:getRequestParams#

#if defined(ENABLE_OVERLOADING)
    WebsocketExtensionGetRequestParamsMethodInfo,
#endif
    websocketExtensionGetRequestParams      ,


-- ** getResponseParams #method:getResponseParams#

#if defined(ENABLE_OVERLOADING)
    WebsocketExtensionGetResponseParamsMethodInfo,
#endif
    websocketExtensionGetResponseParams     ,


-- ** processIncomingMessage #method:processIncomingMessage#

#if defined(ENABLE_OVERLOADING)
    WebsocketExtensionProcessIncomingMessageMethodInfo,
#endif
    websocketExtensionProcessIncomingMessage,


-- ** processOutgoingMessage #method:processOutgoingMessage#

#if defined(ENABLE_OVERLOADING)
    WebsocketExtensionProcessOutgoingMessageMethodInfo,
#endif
    websocketExtensionProcessOutgoingMessage,




    ) 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.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.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 GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums

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

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

foreign import ccall "soup_websocket_extension_get_type"
    c_soup_websocket_extension_get_type :: IO B.Types.GType

instance B.Types.TypedObject WebsocketExtension where
    glibType :: IO GType
glibType = IO GType
c_soup_websocket_extension_get_type

instance B.Types.GObject WebsocketExtension

-- | Type class for types which can be safely cast to `WebsocketExtension`, for instance with `toWebsocketExtension`.
class (SP.GObject o, O.IsDescendantOf WebsocketExtension o) => IsWebsocketExtension o
instance (SP.GObject o, O.IsDescendantOf WebsocketExtension o) => IsWebsocketExtension o

instance O.HasParentTypes WebsocketExtension
type instance O.ParentTypes WebsocketExtension = '[GObject.Object.Object]

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

-- | Convert 'WebsocketExtension' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe WebsocketExtension) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_websocket_extension_get_type
    gvalueSet_ :: Ptr GValue -> Maybe WebsocketExtension -> IO ()
gvalueSet_ Ptr GValue
gv Maybe WebsocketExtension
P.Nothing = Ptr GValue -> Ptr WebsocketExtension -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr WebsocketExtension
forall a. Ptr a
FP.nullPtr :: FP.Ptr WebsocketExtension)
    gvalueSet_ Ptr GValue
gv (P.Just WebsocketExtension
obj) = WebsocketExtension -> (Ptr WebsocketExtension -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr WebsocketExtension
obj (Ptr GValue -> Ptr WebsocketExtension -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe WebsocketExtension)
gvalueGet_ Ptr GValue
gv = do
        Ptr WebsocketExtension
ptr <- Ptr GValue -> IO (Ptr WebsocketExtension)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr WebsocketExtension)
        if Ptr WebsocketExtension
ptr Ptr WebsocketExtension -> Ptr WebsocketExtension -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr WebsocketExtension
forall a. Ptr a
FP.nullPtr
        then WebsocketExtension -> Maybe WebsocketExtension
forall a. a -> Maybe a
P.Just (WebsocketExtension -> Maybe WebsocketExtension)
-> IO WebsocketExtension -> IO (Maybe WebsocketExtension)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr WebsocketExtension -> WebsocketExtension)
-> Ptr WebsocketExtension -> IO WebsocketExtension
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr WebsocketExtension -> WebsocketExtension
WebsocketExtension Ptr WebsocketExtension
ptr
        else Maybe WebsocketExtension -> IO (Maybe WebsocketExtension)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe WebsocketExtension
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveWebsocketExtensionMethod (t :: Symbol) (o :: *) :: * where
    ResolveWebsocketExtensionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveWebsocketExtensionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveWebsocketExtensionMethod "configure" o = WebsocketExtensionConfigureMethodInfo
    ResolveWebsocketExtensionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveWebsocketExtensionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveWebsocketExtensionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveWebsocketExtensionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveWebsocketExtensionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveWebsocketExtensionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveWebsocketExtensionMethod "processIncomingMessage" o = WebsocketExtensionProcessIncomingMessageMethodInfo
    ResolveWebsocketExtensionMethod "processOutgoingMessage" o = WebsocketExtensionProcessOutgoingMessageMethodInfo
    ResolveWebsocketExtensionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveWebsocketExtensionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveWebsocketExtensionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveWebsocketExtensionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveWebsocketExtensionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveWebsocketExtensionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveWebsocketExtensionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveWebsocketExtensionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveWebsocketExtensionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveWebsocketExtensionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveWebsocketExtensionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveWebsocketExtensionMethod "getRequestParams" o = WebsocketExtensionGetRequestParamsMethodInfo
    ResolveWebsocketExtensionMethod "getResponseParams" o = WebsocketExtensionGetResponseParamsMethodInfo
    ResolveWebsocketExtensionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveWebsocketExtensionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveWebsocketExtensionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveWebsocketExtensionMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList WebsocketExtension
type instance O.AttributeList WebsocketExtension = WebsocketExtensionAttributeList
type WebsocketExtensionAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList WebsocketExtension = WebsocketExtensionSignalList
type WebsocketExtensionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method WebsocketExtension::configure
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "extension"
--           , argType =
--               TInterface
--                 Name { namespace = "Soup" , name = "WebsocketExtension" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupWebsocketExtension"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "connection_type"
--           , argType =
--               TInterface
--                 Name { namespace = "Soup" , name = "WebsocketConnectionType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "either %SOUP_WEBSOCKET_CONNECTION_CLIENT or %SOUP_WEBSOCKET_CONNECTION_SERVER"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "params"
--           , argType = TGHash (TBasicType TPtr) (TBasicType TPtr)
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the parameters, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "soup_websocket_extension_configure" soup_websocket_extension_configure :: 
    Ptr WebsocketExtension ->               -- extension : TInterface (Name {namespace = "Soup", name = "WebsocketExtension"})
    CUInt ->                                -- connection_type : TInterface (Name {namespace = "Soup", name = "WebsocketConnectionType"})
    Ptr (GHashTable (Ptr ()) (Ptr ())) ->   -- params : TGHash (TBasicType TPtr) (TBasicType TPtr)
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Configures /@extension@/ with the given /@params@/
websocketExtensionConfigure ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebsocketExtension a) =>
    a
    -- ^ /@extension@/: a t'GI.Soup.Objects.WebsocketExtension.WebsocketExtension'
    -> Soup.Enums.WebsocketConnectionType
    -- ^ /@connectionType@/: either 'GI.Soup.Enums.WebsocketConnectionTypeClient' or 'GI.Soup.Enums.WebsocketConnectionTypeServer'
    -> Maybe (Map.Map (Ptr ()) (Ptr ()))
    -- ^ /@params@/: the parameters, or 'P.Nothing'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
websocketExtensionConfigure :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebsocketExtension a) =>
a
-> WebsocketConnectionType -> Maybe (Map (Ptr ()) (Ptr ())) -> m ()
websocketExtensionConfigure a
extension WebsocketConnectionType
connectionType Maybe (Map (Ptr ()) (Ptr ()))
params = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsocketExtension
extension' <- a -> IO (Ptr WebsocketExtension)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
extension
    let connectionType' :: CUInt
connectionType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (WebsocketConnectionType -> Int)
-> WebsocketConnectionType
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WebsocketConnectionType -> Int
forall a. Enum a => a -> Int
fromEnum) WebsocketConnectionType
connectionType
    Ptr (GHashTable (Ptr ()) (Ptr ()))
maybeParams <- case Maybe (Map (Ptr ()) (Ptr ()))
params of
        Maybe (Map (Ptr ()) (Ptr ()))
Nothing -> Ptr (GHashTable (Ptr ()) (Ptr ()))
-> IO (Ptr (GHashTable (Ptr ()) (Ptr ())))
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GHashTable (Ptr ()) (Ptr ()))
forall a. Ptr a
nullPtr
        Just Map (Ptr ()) (Ptr ())
jParams -> do
            let jParams' :: [(Ptr (), Ptr ())]
jParams' = Map (Ptr ()) (Ptr ()) -> [(Ptr (), Ptr ())]
forall k a. Map k a -> [(k, a)]
Map.toList Map (Ptr ()) (Ptr ())
jParams
            let jParams'' :: [(PtrWrapped (Ptr ()), Ptr ())]
jParams'' = (Ptr () -> PtrWrapped (Ptr ()))
-> [(Ptr (), Ptr ())] -> [(PtrWrapped (Ptr ()), Ptr ())]
forall a c b. (a -> c) -> [(a, b)] -> [(c, b)]
mapFirst Ptr () -> PtrWrapped (Ptr ())
forall a. Ptr a -> PtrWrapped (Ptr a)
ptrPackPtr [(Ptr (), Ptr ())]
jParams'
            let jParams''' :: [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
jParams''' = (Ptr () -> PtrWrapped (Ptr ()))
-> [(PtrWrapped (Ptr ()), Ptr ())]
-> [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
forall b c a. (b -> c) -> [(a, b)] -> [(a, c)]
mapSecond Ptr () -> PtrWrapped (Ptr ())
forall a. Ptr a -> PtrWrapped (Ptr a)
ptrPackPtr [(PtrWrapped (Ptr ()), Ptr ())]
jParams''
            Ptr (GHashTable (Ptr ()) (Ptr ()))
jParams'''' <- GHashFunc (Ptr ())
-> GEqualFunc (Ptr ())
-> Maybe (GDestroyNotify (Ptr ()))
-> Maybe (GDestroyNotify (Ptr ()))
-> [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
-> IO (Ptr (GHashTable (Ptr ()) (Ptr ())))
forall a b.
GHashFunc a
-> GEqualFunc a
-> Maybe (GDestroyNotify a)
-> Maybe (GDestroyNotify b)
-> [(PtrWrapped a, PtrWrapped b)]
-> IO (Ptr (GHashTable a b))
packGHashTable GHashFunc (Ptr ())
forall a. GHashFunc (Ptr a)
gDirectHash GEqualFunc (Ptr ())
forall a. GEqualFunc (Ptr a)
gDirectEqual Maybe (GDestroyNotify (Ptr ()))
forall a. Maybe a
Nothing Maybe (GDestroyNotify (Ptr ()))
forall a. Maybe a
Nothing [(PtrWrapped (Ptr ()), PtrWrapped (Ptr ()))]
jParams'''
            Ptr (GHashTable (Ptr ()) (Ptr ()))
-> IO (Ptr (GHashTable (Ptr ()) (Ptr ())))
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GHashTable (Ptr ()) (Ptr ()))
jParams''''
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr WebsocketExtension
-> CUInt
-> Ptr (GHashTable (Ptr ()) (Ptr ()))
-> Ptr (Ptr GError)
-> IO CInt
soup_websocket_extension_configure Ptr WebsocketExtension
extension' CUInt
connectionType' Ptr (GHashTable (Ptr ()) (Ptr ()))
maybeParams
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
extension
        Ptr (GHashTable (Ptr ()) (Ptr ())) -> IO ()
forall a b. Ptr (GHashTable a b) -> IO ()
unrefGHashTable Ptr (GHashTable (Ptr ()) (Ptr ()))
maybeParams
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        Ptr (GHashTable (Ptr ()) (Ptr ())) -> IO ()
forall a b. Ptr (GHashTable a b) -> IO ()
unrefGHashTable Ptr (GHashTable (Ptr ()) (Ptr ()))
maybeParams
     )

#if defined(ENABLE_OVERLOADING)
data WebsocketExtensionConfigureMethodInfo
instance (signature ~ (Soup.Enums.WebsocketConnectionType -> Maybe (Map.Map (Ptr ()) (Ptr ())) -> m ()), MonadIO m, IsWebsocketExtension a) => O.OverloadedMethod WebsocketExtensionConfigureMethodInfo a signature where
    overloadedMethod = websocketExtensionConfigure

instance O.OverloadedMethodInfo WebsocketExtensionConfigureMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.WebsocketExtension.websocketExtensionConfigure",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-WebsocketExtension.html#v:websocketExtensionConfigure"
        })


#endif

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

foreign import ccall "soup_websocket_extension_get_request_params" soup_websocket_extension_get_request_params :: 
    Ptr WebsocketExtension ->               -- extension : TInterface (Name {namespace = "Soup", name = "WebsocketExtension"})
    IO CString

-- | Get the parameters strings to be included in the request header. If the extension
-- doesn\'t include any parameter in the request, this function returns 'P.Nothing'.
-- 
-- /Since: 2.68/
websocketExtensionGetRequestParams ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebsocketExtension a) =>
    a
    -- ^ /@extension@/: a t'GI.Soup.Objects.WebsocketExtension.WebsocketExtension'
    -> m (Maybe T.Text)
    -- ^ __Returns:__ a new allocated string with the parameters
websocketExtensionGetRequestParams :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebsocketExtension a) =>
a -> m (Maybe Text)
websocketExtensionGetRequestParams a
extension = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsocketExtension
extension' <- a -> IO (Ptr WebsocketExtension)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
extension
    CString
result <- Ptr WebsocketExtension -> IO CString
soup_websocket_extension_get_request_params Ptr WebsocketExtension
extension'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
extension
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data WebsocketExtensionGetRequestParamsMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsWebsocketExtension a) => O.OverloadedMethod WebsocketExtensionGetRequestParamsMethodInfo a signature where
    overloadedMethod = websocketExtensionGetRequestParams

instance O.OverloadedMethodInfo WebsocketExtensionGetRequestParamsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.WebsocketExtension.websocketExtensionGetRequestParams",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-WebsocketExtension.html#v:websocketExtensionGetRequestParams"
        })


#endif

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

foreign import ccall "soup_websocket_extension_get_response_params" soup_websocket_extension_get_response_params :: 
    Ptr WebsocketExtension ->               -- extension : TInterface (Name {namespace = "Soup", name = "WebsocketExtension"})
    IO CString

-- | Get the parameters strings to be included in the response header. If the extension
-- doesn\'t include any parameter in the response, this function returns 'P.Nothing'.
-- 
-- /Since: 2.68/
websocketExtensionGetResponseParams ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebsocketExtension a) =>
    a
    -- ^ /@extension@/: a t'GI.Soup.Objects.WebsocketExtension.WebsocketExtension'
    -> m (Maybe T.Text)
    -- ^ __Returns:__ a new allocated string with the parameters
websocketExtensionGetResponseParams :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebsocketExtension a) =>
a -> m (Maybe Text)
websocketExtensionGetResponseParams a
extension = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsocketExtension
extension' <- a -> IO (Ptr WebsocketExtension)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
extension
    CString
result <- Ptr WebsocketExtension -> IO CString
soup_websocket_extension_get_response_params Ptr WebsocketExtension
extension'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
extension
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data WebsocketExtensionGetResponseParamsMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsWebsocketExtension a) => O.OverloadedMethod WebsocketExtensionGetResponseParamsMethodInfo a signature where
    overloadedMethod = websocketExtensionGetResponseParams

instance O.OverloadedMethodInfo WebsocketExtensionGetResponseParamsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.WebsocketExtension.websocketExtensionGetResponseParams",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-WebsocketExtension.html#v:websocketExtensionGetResponseParams"
        })


#endif

-- method WebsocketExtension::process_incoming_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "extension"
--           , argType =
--               TInterface
--                 Name { namespace = "Soup" , name = "WebsocketExtension" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupWebsocketExtension"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "header"
--           , argType = TBasicType TUInt8
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message header" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "payload"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the payload data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "Bytes" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_websocket_extension_process_incoming_message" soup_websocket_extension_process_incoming_message :: 
    Ptr WebsocketExtension ->               -- extension : TInterface (Name {namespace = "Soup", name = "WebsocketExtension"})
    Ptr Word8 ->                            -- header : TBasicType TUInt8
    Ptr GLib.Bytes.Bytes ->                 -- payload : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr GLib.Bytes.Bytes)

-- | Process a message after it\'s received. If the payload isn\'t changed the given
-- /@payload@/ is just returned, otherwise 'GI.GLib.Structs.Bytes.bytesUnref' is called on the given
-- /@payload@/ and a new t'GI.GLib.Structs.Bytes.Bytes' is returned with the new data.
-- 
-- Extensions using reserved bits of the header will reset them in /@header@/.
-- 
-- /Since: 2.68/
websocketExtensionProcessIncomingMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebsocketExtension a) =>
    a
    -- ^ /@extension@/: a t'GI.Soup.Objects.WebsocketExtension.WebsocketExtension'
    -> Word8
    -- ^ /@header@/: the message header
    -> GLib.Bytes.Bytes
    -- ^ /@payload@/: the payload data
    -> m ((GLib.Bytes.Bytes, Word8))
    -- ^ __Returns:__ the message payload data, or 'P.Nothing' in case of error /(Can throw 'Data.GI.Base.GError.GError')/
websocketExtensionProcessIncomingMessage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebsocketExtension a) =>
a -> Word8 -> Bytes -> m (Bytes, Word8)
websocketExtensionProcessIncomingMessage a
extension Word8
header Bytes
payload = IO (Bytes, Word8) -> m (Bytes, Word8)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bytes, Word8) -> m (Bytes, Word8))
-> IO (Bytes, Word8) -> m (Bytes, Word8)
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsocketExtension
extension' <- a -> IO (Ptr WebsocketExtension)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
extension
    Ptr Word8
header' <- IO (Ptr Word8)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word8)
    Ptr Word8 -> Word8 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word8
header' Word8
header
    Ptr Bytes
payload' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Bytes
payload
    IO (Bytes, Word8) -> IO () -> IO (Bytes, Word8)
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr Bytes
result <- (Ptr (Ptr GError) -> IO (Ptr Bytes)) -> IO (Ptr Bytes)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Bytes)) -> IO (Ptr Bytes))
-> (Ptr (Ptr GError) -> IO (Ptr Bytes)) -> IO (Ptr Bytes)
forall a b. (a -> b) -> a -> b
$ Ptr WebsocketExtension
-> Ptr Word8 -> Ptr Bytes -> Ptr (Ptr GError) -> IO (Ptr Bytes)
soup_websocket_extension_process_incoming_message Ptr WebsocketExtension
extension' Ptr Word8
header' Ptr Bytes
payload'
        Text -> Ptr Bytes -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websocketExtensionProcessIncomingMessage" Ptr Bytes
result
        Bytes
result' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
result
        Word8
header'' <- Ptr Word8 -> IO Word8
forall a. Storable a => Ptr a -> IO a
peek Ptr Word8
header'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
extension
        Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
payload
        Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
header'
        (Bytes, Word8) -> IO (Bytes, Word8)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bytes
result', Word8
header'')
     ) (do
        Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
header'
     )

#if defined(ENABLE_OVERLOADING)
data WebsocketExtensionProcessIncomingMessageMethodInfo
instance (signature ~ (Word8 -> GLib.Bytes.Bytes -> m ((GLib.Bytes.Bytes, Word8))), MonadIO m, IsWebsocketExtension a) => O.OverloadedMethod WebsocketExtensionProcessIncomingMessageMethodInfo a signature where
    overloadedMethod = websocketExtensionProcessIncomingMessage

instance O.OverloadedMethodInfo WebsocketExtensionProcessIncomingMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.WebsocketExtension.websocketExtensionProcessIncomingMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-WebsocketExtension.html#v:websocketExtensionProcessIncomingMessage"
        })


#endif

-- method WebsocketExtension::process_outgoing_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "extension"
--           , argType =
--               TInterface
--                 Name { namespace = "Soup" , name = "WebsocketExtension" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupWebsocketExtension"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "header"
--           , argType = TBasicType TUInt8
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message header" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "payload"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the payload data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "Bytes" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_websocket_extension_process_outgoing_message" soup_websocket_extension_process_outgoing_message :: 
    Ptr WebsocketExtension ->               -- extension : TInterface (Name {namespace = "Soup", name = "WebsocketExtension"})
    Ptr Word8 ->                            -- header : TBasicType TUInt8
    Ptr GLib.Bytes.Bytes ->                 -- payload : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr GLib.Bytes.Bytes)

-- | Process a message before it\'s sent. If the payload isn\'t changed the given
-- /@payload@/ is just returned, otherwise 'GI.GLib.Structs.Bytes.bytesUnref' is called on the given
-- /@payload@/ and a new t'GI.GLib.Structs.Bytes.Bytes' is returned with the new data.
-- 
-- Extensions using reserved bits of the header will change them in /@header@/.
-- 
-- /Since: 2.68/
websocketExtensionProcessOutgoingMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebsocketExtension a) =>
    a
    -- ^ /@extension@/: a t'GI.Soup.Objects.WebsocketExtension.WebsocketExtension'
    -> Word8
    -- ^ /@header@/: the message header
    -> GLib.Bytes.Bytes
    -- ^ /@payload@/: the payload data
    -> m ((GLib.Bytes.Bytes, Word8))
    -- ^ __Returns:__ the message payload data, or 'P.Nothing' in case of error /(Can throw 'Data.GI.Base.GError.GError')/
websocketExtensionProcessOutgoingMessage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebsocketExtension a) =>
a -> Word8 -> Bytes -> m (Bytes, Word8)
websocketExtensionProcessOutgoingMessage a
extension Word8
header Bytes
payload = IO (Bytes, Word8) -> m (Bytes, Word8)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bytes, Word8) -> m (Bytes, Word8))
-> IO (Bytes, Word8) -> m (Bytes, Word8)
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsocketExtension
extension' <- a -> IO (Ptr WebsocketExtension)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
extension
    Ptr Word8
header' <- IO (Ptr Word8)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word8)
    Ptr Word8 -> Word8 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word8
header' Word8
header
    Ptr Bytes
payload' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Bytes
payload
    IO (Bytes, Word8) -> IO () -> IO (Bytes, Word8)
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr Bytes
result <- (Ptr (Ptr GError) -> IO (Ptr Bytes)) -> IO (Ptr Bytes)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Bytes)) -> IO (Ptr Bytes))
-> (Ptr (Ptr GError) -> IO (Ptr Bytes)) -> IO (Ptr Bytes)
forall a b. (a -> b) -> a -> b
$ Ptr WebsocketExtension
-> Ptr Word8 -> Ptr Bytes -> Ptr (Ptr GError) -> IO (Ptr Bytes)
soup_websocket_extension_process_outgoing_message Ptr WebsocketExtension
extension' Ptr Word8
header' Ptr Bytes
payload'
        Text -> Ptr Bytes -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websocketExtensionProcessOutgoingMessage" Ptr Bytes
result
        Bytes
result' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
result
        Word8
header'' <- Ptr Word8 -> IO Word8
forall a. Storable a => Ptr a -> IO a
peek Ptr Word8
header'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
extension
        Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
payload
        Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
header'
        (Bytes, Word8) -> IO (Bytes, Word8)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bytes
result', Word8
header'')
     ) (do
        Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
header'
     )

#if defined(ENABLE_OVERLOADING)
data WebsocketExtensionProcessOutgoingMessageMethodInfo
instance (signature ~ (Word8 -> GLib.Bytes.Bytes -> m ((GLib.Bytes.Bytes, Word8))), MonadIO m, IsWebsocketExtension a) => O.OverloadedMethod WebsocketExtensionProcessOutgoingMessageMethodInfo a signature where
    overloadedMethod = websocketExtensionProcessOutgoingMessage

instance O.OverloadedMethodInfo WebsocketExtensionProcessOutgoingMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.WebsocketExtension.websocketExtensionProcessOutgoingMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-WebsocketExtension.html#v:websocketExtensionProcessOutgoingMessage"
        })


#endif