packages feed

gi-wireplumber-0.5.14: GI/Wp/Structs/SpaJson.hs

{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./
-- 
-- /Since: 0.4.8/

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

module GI.Wp.Structs.SpaJson
    ( 

-- * Exported types
    SpaJson(..)                             ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [copy]("GI.Wp.Structs.SpaJson#g:method:copy"), [ensureUniqueOwner]("GI.Wp.Structs.SpaJson#g:method:ensureUniqueOwner"), [isArray]("GI.Wp.Structs.SpaJson#g:method:isArray"), [isBoolean]("GI.Wp.Structs.SpaJson#g:method:isBoolean"), [isContainer]("GI.Wp.Structs.SpaJson#g:method:isContainer"), [isFloat]("GI.Wp.Structs.SpaJson#g:method:isFloat"), [isInt]("GI.Wp.Structs.SpaJson#g:method:isInt"), [isNull]("GI.Wp.Structs.SpaJson#g:method:isNull"), [isObject]("GI.Wp.Structs.SpaJson#g:method:isObject"), [isString]("GI.Wp.Structs.SpaJson#g:method:isString"), [isUniqueOwner]("GI.Wp.Structs.SpaJson#g:method:isUniqueOwner"), [newIterator]("GI.Wp.Structs.SpaJson#g:method:newIterator"), [parseBoolean]("GI.Wp.Structs.SpaJson#g:method:parseBoolean"), [parseFloat]("GI.Wp.Structs.SpaJson#g:method:parseFloat"), [parseInt]("GI.Wp.Structs.SpaJson#g:method:parseInt"), [parseString]("GI.Wp.Structs.SpaJson#g:method:parseString"), [ref]("GI.Wp.Structs.SpaJson#g:method:ref"), [toString]("GI.Wp.Structs.SpaJson#g:method:toString"), [unref]("GI.Wp.Structs.SpaJson#g:method:unref").
-- 
-- ==== Getters
-- [getData]("GI.Wp.Structs.SpaJson#g:method:getData"), [getSize]("GI.Wp.Structs.SpaJson#g:method:getSize"), [getSpaJson]("GI.Wp.Structs.SpaJson#g:method:getSpaJson").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveSpaJsonMethod                    ,
#endif

-- ** copy #method:copy#

#if defined(ENABLE_OVERLOADING)
    SpaJsonCopyMethodInfo                   ,
#endif
    spaJsonCopy                             ,


-- ** ensureUniqueOwner #method:ensureUniqueOwner#

#if defined(ENABLE_OVERLOADING)
    SpaJsonEnsureUniqueOwnerMethodInfo      ,
#endif
    spaJsonEnsureUniqueOwner                ,


-- ** getData #method:getData#

#if defined(ENABLE_OVERLOADING)
    SpaJsonGetDataMethodInfo                ,
#endif
    spaJsonGetData                          ,


-- ** getSize #method:getSize#

#if defined(ENABLE_OVERLOADING)
    SpaJsonGetSizeMethodInfo                ,
#endif
    spaJsonGetSize                          ,


-- ** getSpaJson #method:getSpaJson#

#if defined(ENABLE_OVERLOADING)
    SpaJsonGetSpaJsonMethodInfo             ,
#endif
    spaJsonGetSpaJson                       ,


-- ** isArray #method:isArray#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsArrayMethodInfo                ,
#endif
    spaJsonIsArray                          ,


-- ** isBoolean #method:isBoolean#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsBooleanMethodInfo              ,
#endif
    spaJsonIsBoolean                        ,


-- ** isContainer #method:isContainer#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsContainerMethodInfo            ,
#endif
    spaJsonIsContainer                      ,


-- ** isFloat #method:isFloat#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsFloatMethodInfo                ,
#endif
    spaJsonIsFloat                          ,


-- ** isInt #method:isInt#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsIntMethodInfo                  ,
#endif
    spaJsonIsInt                            ,


-- ** isNull #method:isNull#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsNullMethodInfo                 ,
#endif
    spaJsonIsNull                           ,


-- ** isObject #method:isObject#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsObjectMethodInfo               ,
#endif
    spaJsonIsObject                         ,


-- ** isString #method:isString#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsStringMethodInfo               ,
#endif
    spaJsonIsString                         ,


-- ** isUniqueOwner #method:isUniqueOwner#

#if defined(ENABLE_OVERLOADING)
    SpaJsonIsUniqueOwnerMethodInfo          ,
#endif
    spaJsonIsUniqueOwner                    ,


-- ** newBoolean #method:newBoolean#

    spaJsonNewBoolean                       ,


-- ** newFloat #method:newFloat#

    spaJsonNewFloat                         ,


-- ** newFromString #method:newFromString#

    spaJsonNewFromString                    ,


-- ** newFromStringn #method:newFromStringn#

    spaJsonNewFromStringn                   ,


-- ** newInt #method:newInt#

    spaJsonNewInt                           ,


-- ** newIterator #method:newIterator#

#if defined(ENABLE_OVERLOADING)
    SpaJsonNewIteratorMethodInfo            ,
#endif
    spaJsonNewIterator                      ,


-- ** newNull #method:newNull#

    spaJsonNewNull                          ,


-- ** newString #method:newString#

    spaJsonNewString                        ,


-- ** newWrap #method:newWrap#

    spaJsonNewWrap                          ,


-- ** newWrapString #method:newWrapString#

    spaJsonNewWrapString                    ,


-- ** newWrapStringn #method:newWrapStringn#

    spaJsonNewWrapStringn                   ,


-- ** parseBoolean #method:parseBoolean#

#if defined(ENABLE_OVERLOADING)
    SpaJsonParseBooleanMethodInfo           ,
#endif
    spaJsonParseBoolean                     ,


-- ** parseFloat #method:parseFloat#

#if defined(ENABLE_OVERLOADING)
    SpaJsonParseFloatMethodInfo             ,
#endif
    spaJsonParseFloat                       ,


-- ** parseInt #method:parseInt#

#if defined(ENABLE_OVERLOADING)
    SpaJsonParseIntMethodInfo               ,
#endif
    spaJsonParseInt                         ,


-- ** parseString #method:parseString#

#if defined(ENABLE_OVERLOADING)
    SpaJsonParseStringMethodInfo            ,
#endif
    spaJsonParseString                      ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    SpaJsonRefMethodInfo                    ,
#endif
    spaJsonRef                              ,


-- ** toString #method:toString#

#if defined(ENABLE_OVERLOADING)
    SpaJsonToStringMethodInfo               ,
#endif
    spaJsonToString                         ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    SpaJsonUnrefMethodInfo                  ,
#endif
    spaJsonUnref                            ,




    ) 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.Wp.Callbacks as Wp.Callbacks
import {-# SOURCE #-} qualified GI.Wp.Structs.Iterator as Wp.Iterator
import {-# SOURCE #-} qualified GI.Wp.Structs.IteratorMethods as Wp.IteratorMethods

#else
import {-# SOURCE #-} qualified GI.Wp.Structs.Iterator as Wp.Iterator

#endif

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

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

foreign import ccall "wp_spa_json_get_type" c_wp_spa_json_get_type :: 
    IO GType

type instance O.ParentTypes SpaJson = '[]
instance O.HasParentTypes SpaJson

instance B.Types.TypedObject SpaJson where
    glibType = c_wp_spa_json_get_type

instance B.Types.GBoxed SpaJson

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


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SpaJson
type instance O.AttributeList SpaJson = SpaJsonAttributeList
type SpaJsonAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

-- method SpaJson::new_boolean
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "value"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the boolean value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_boolean" wp_spa_json_new_boolean :: 
    CInt ->                                 -- value : TBasicType TBoolean
    IO (Ptr SpaJson)

-- | Creates a spa json of type boolean.
spaJsonNewBoolean ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Bool
    -- ^ /@value@/: the boolean value
    -> m SpaJson
    -- ^ __Returns:__ The new spa json
spaJsonNewBoolean value = liftIO $ do
    let value' = (P.fromIntegral . P.fromEnum) value
    result <- wp_spa_json_new_boolean value'
    checkUnexpectedReturnNULL "spaJsonNewBoolean" result
    result' <- (wrapBoxed SpaJson) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_float
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "value"
--           , argType = TBasicType TFloat
--           , argCType = Just "float"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the float value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_float" wp_spa_json_new_float :: 
    CFloat ->                               -- value : TBasicType TFloat
    IO (Ptr SpaJson)

-- | Creates a spa json of type float.
spaJsonNewFloat ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Float
    -- ^ /@value@/: the float value
    -> m SpaJson
    -- ^ __Returns:__ The new spa json
spaJsonNewFloat value = liftIO $ do
    let value' = realToFrac value
    result <- wp_spa_json_new_float value'
    checkUnexpectedReturnNULL "spaJsonNewFloat" result
    result' <- (wrapBoxed SpaJson) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_from_string
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "json_str"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a JSON string" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_from_string" wp_spa_json_new_from_string :: 
    CString ->                              -- json_str : TBasicType TUTF8
    IO (Ptr SpaJson)

-- | Constructs a new WpSpaJson from a JSON string.
-- 
-- /Since: 0.5.0/
spaJsonNewFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@jsonStr@/: a JSON string
    -> m SpaJson
    -- ^ __Returns:__ a new WpSpaJson; unlike the \"wrap\" variants, this function copies the data in /@jsonStr@/, so it does not need to stay alive.
spaJsonNewFromString jsonStr = liftIO $ do
    jsonStr' <- textToCString jsonStr
    result <- wp_spa_json_new_from_string jsonStr'
    checkUnexpectedReturnNULL "spaJsonNewFromString" result
    result' <- (wrapBoxed SpaJson) result
    freeMem jsonStr'
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_from_stringn
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "json_str"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a JSON string" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "len"
--           , argType = TBasicType TSize
--           , argCType = Just "size_t"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the specific length of the string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_from_stringn" wp_spa_json_new_from_stringn :: 
    CString ->                              -- json_str : TBasicType TUTF8
    FCT.CSize ->                            -- len : TBasicType TSize
    IO (Ptr SpaJson)

-- | Constructs a new WpSpaJson from a JSON string with specific length.
-- 
-- /Since: 0.5.0/
spaJsonNewFromStringn ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@jsonStr@/: a JSON string
    -> FCT.CSize
    -- ^ /@len@/: the specific length of the string
    -> m SpaJson
    -- ^ __Returns:__ a new WpSpaJson; unlike the \"wrap\" variants, this function copies the data in /@jsonStr@/, so it does not need to stay alive.
spaJsonNewFromStringn jsonStr len = liftIO $ do
    jsonStr' <- textToCString jsonStr
    result <- wp_spa_json_new_from_stringn jsonStr' len
    checkUnexpectedReturnNULL "spaJsonNewFromStringn" result
    result' <- (wrapBoxed SpaJson) result
    freeMem jsonStr'
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_int
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "value"
--           , argType = TBasicType TInt
--           , argCType = Just "gint"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the int value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_int" wp_spa_json_new_int :: 
    Int32 ->                                -- value : TBasicType TInt
    IO (Ptr SpaJson)

-- | Creates a spa json of type int.
spaJsonNewInt ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Int32
    -- ^ /@value@/: the int value
    -> m SpaJson
    -- ^ __Returns:__ The new spa json
spaJsonNewInt value = liftIO $ do
    result <- wp_spa_json_new_int value
    checkUnexpectedReturnNULL "spaJsonNewInt" result
    result' <- (wrapBoxed SpaJson) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "wp_spa_json_new_null" wp_spa_json_new_null :: 
    IO (Ptr SpaJson)

-- | Creates a spa json of type NULL.
spaJsonNewNull ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m SpaJson
    -- ^ __Returns:__ The new spa json
spaJsonNewNull  = liftIO $ do
    result <- wp_spa_json_new_null
    checkUnexpectedReturnNULL "spaJsonNewNull" result
    result' <- (wrapBoxed SpaJson) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_string
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "value"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the string value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_string" wp_spa_json_new_string :: 
    CString ->                              -- value : TBasicType TUTF8
    IO (Ptr SpaJson)

-- | Creates a spa json of type string.
spaJsonNewString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@value@/: the string value
    -> m SpaJson
    -- ^ __Returns:__ The new spa json
spaJsonNewString value = liftIO $ do
    value' <- textToCString value
    result <- wp_spa_json_new_string value'
    checkUnexpectedReturnNULL "spaJsonNewString" result
    result' <- (wrapBoxed SpaJson) result
    freeMem value'
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_wrap
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "json"
--           , argType = TBasicType TPtr
--           , argCType = Just "spa_json*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa_json" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_wrap" wp_spa_json_new_wrap :: 
    Ptr () ->                               -- json : TBasicType TPtr
    IO (Ptr SpaJson)

-- | Constructs a new WpSpaJson that wraps the given spa_json.
spaJsonNewWrap ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    -- ^ /@json@/: a spa_json
    -> m SpaJson
    -- ^ __Returns:__ a new WpSpaJson that references the data in /@json@/. /@json@/ is not copied, so it needs to stay alive.
spaJsonNewWrap json = liftIO $ do
    result <- wp_spa_json_new_wrap json
    checkUnexpectedReturnNULL "spaJsonNewWrap" result
    result' <- (wrapBoxed SpaJson) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_wrap_string
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "json_str"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a JSON string" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_wrap_string" wp_spa_json_new_wrap_string :: 
    CString ->                              -- json_str : TBasicType TUTF8
    IO (Ptr SpaJson)

-- | Constructs a new WpSpaJson that wraps a JSON string.
-- 
-- /Since: 0.5.0/
spaJsonNewWrapString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@jsonStr@/: a JSON string
    -> m SpaJson
    -- ^ __Returns:__ a new WpSpaJson that references the data in /@jsonStr@/. /@jsonStr@/ is not copied, so it needs to stay alive.
spaJsonNewWrapString jsonStr = liftIO $ do
    jsonStr' <- textToCString jsonStr
    result <- wp_spa_json_new_wrap_string jsonStr'
    checkUnexpectedReturnNULL "spaJsonNewWrapString" result
    result' <- (wrapBoxed SpaJson) result
    freeMem jsonStr'
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::new_wrap_stringn
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "json_str"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a JSON string" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "len"
--           , argType = TBasicType TSize
--           , argCType = Just "size_t"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the specific length of the string"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_wrap_stringn" wp_spa_json_new_wrap_stringn :: 
    CString ->                              -- json_str : TBasicType TUTF8
    FCT.CSize ->                            -- len : TBasicType TSize
    IO (Ptr SpaJson)

-- | Constructs a new WpSpaJson that wraps a JSON string with specific length.
-- 
-- /Since: 0.5.0/
spaJsonNewWrapStringn ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@jsonStr@/: a JSON string
    -> FCT.CSize
    -- ^ /@len@/: the specific length of the string
    -> m SpaJson
    -- ^ __Returns:__ a new WpSpaJson that references the data in /@jsonStr@/. /@jsonStr@/ is not copied, so it needs to stay alive.
spaJsonNewWrapStringn jsonStr len = liftIO $ do
    jsonStr' <- textToCString jsonStr
    result <- wp_spa_json_new_wrap_stringn jsonStr' len
    checkUnexpectedReturnNULL "spaJsonNewWrapStringn" result
    result' <- (wrapBoxed SpaJson) result
    freeMem jsonStr'
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SpaJson::copy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "other"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_copy" wp_spa_json_copy :: 
    Ptr SpaJson ->                          -- other : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO (Ptr SpaJson)

-- | Copies a spa json object.
spaJsonCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@other@/: a spa json object
    -> m SpaJson
    -- ^ __Returns:__ The newly copied spa json
spaJsonCopy other = liftIO $ do
    other' <- unsafeManagedPtrGetPtr other
    result <- wp_spa_json_copy other'
    checkUnexpectedReturnNULL "spaJsonCopy" result
    result' <- (wrapBoxed SpaJson) result
    touchManagedPtr other
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonCopyMethodInfo
instance (signature ~ (m SpaJson), MonadIO m) => O.OverloadedMethod SpaJsonCopyMethodInfo SpaJson signature where
    overloadedMethod = spaJsonCopy

instance O.OverloadedMethodInfo SpaJsonCopyMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonCopy",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonCopy"
        })


#endif

-- method SpaJson::ensure_unique_owner
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_ensure_unique_owner" wp_spa_json_ensure_unique_owner :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO (Ptr SpaJson)

-- | If /@self@/ is not uniquely owned already, then it is unrefed and a copy of it is returned instead. You should always consider /@self@/ as unsafe to use after this call and you should use the returned object instead.
spaJsonEnsureUniqueOwner ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m SpaJson
    -- ^ __Returns:__ the uniquely owned spa json object which may or may not be the same as /@self@/.
spaJsonEnsureUniqueOwner self = liftIO $ do
    self' <- B.ManagedPtr.disownBoxed self
    result <- wp_spa_json_ensure_unique_owner self'
    checkUnexpectedReturnNULL "spaJsonEnsureUniqueOwner" result
    result' <- (wrapBoxed SpaJson) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonEnsureUniqueOwnerMethodInfo
instance (signature ~ (m SpaJson), MonadIO m) => O.OverloadedMethod SpaJsonEnsureUniqueOwnerMethodInfo SpaJson signature where
    overloadedMethod = spaJsonEnsureUniqueOwner

instance O.OverloadedMethodInfo SpaJsonEnsureUniqueOwnerMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonEnsureUniqueOwner",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonEnsureUniqueOwner"
        })


#endif

-- method SpaJson::get_data
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "const WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_get_data" wp_spa_json_get_data :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CString

-- | Returns the json data.
spaJsonGetData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m T.Text
    -- ^ __Returns:__ a const pointer to the json data
spaJsonGetData self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_get_data self'
    checkUnexpectedReturnNULL "spaJsonGetData" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonGetDataMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod SpaJsonGetDataMethodInfo SpaJson signature where
    overloadedMethod = spaJsonGetData

instance O.OverloadedMethodInfo SpaJsonGetDataMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonGetData",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonGetData"
        })


#endif

-- method SpaJson::get_size
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "const WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TSize)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_get_size" wp_spa_json_get_size :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO FCT.CSize

-- | Returns the json data size.
spaJsonGetSize ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m FCT.CSize
    -- ^ __Returns:__ the json data size
spaJsonGetSize self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_get_size self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data SpaJsonGetSizeMethodInfo
instance (signature ~ (m FCT.CSize), MonadIO m) => O.OverloadedMethod SpaJsonGetSizeMethodInfo SpaJson signature where
    overloadedMethod = spaJsonGetSize

instance O.OverloadedMethodInfo SpaJsonGetSizeMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonGetSize",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonGetSize"
        })


#endif

-- method SpaJson::get_spa_json
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "const WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_get_spa_json" wp_spa_json_get_spa_json :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO (Ptr ())

-- | Converts a WpSpaJson pointer to a struct spa_json one, for use with native pipewire & spa functions. The returned pointer is owned by WpSpaJson and may not be modified or freed.
spaJsonGetSpaJson ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m (Ptr ())
    -- ^ __Returns:__ a const pointer to the underlying spa_json structure
spaJsonGetSpaJson self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_get_spa_json self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data SpaJsonGetSpaJsonMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod SpaJsonGetSpaJsonMethodInfo SpaJson signature where
    overloadedMethod = spaJsonGetSpaJson

instance O.OverloadedMethodInfo SpaJsonGetSpaJsonMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonGetSpaJson",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonGetSpaJson"
        })


#endif

-- method SpaJson::is_array
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_array" wp_spa_json_is_array :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type array or not.
spaJsonIsArray ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type array, FALSE otherwise
spaJsonIsArray self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_array self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsArrayMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsArrayMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsArray

instance O.OverloadedMethodInfo SpaJsonIsArrayMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsArray",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsArray"
        })


#endif

-- method SpaJson::is_boolean
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_boolean" wp_spa_json_is_boolean :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type boolean or not.
spaJsonIsBoolean ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type boolean, FALSE otherwise
spaJsonIsBoolean self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_boolean self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsBooleanMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsBooleanMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsBoolean

instance O.OverloadedMethodInfo SpaJsonIsBooleanMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsBoolean",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsBoolean"
        })


#endif

-- method SpaJson::is_container
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_container" wp_spa_json_is_container :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type container or not.
spaJsonIsContainer ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type container, FALSE otherwise
spaJsonIsContainer self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_container self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsContainerMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsContainerMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsContainer

instance O.OverloadedMethodInfo SpaJsonIsContainerMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsContainer",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsContainer"
        })


#endif

-- method SpaJson::is_float
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_float" wp_spa_json_is_float :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type float or not.
spaJsonIsFloat ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type float, FALSE otherwise
spaJsonIsFloat self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_float self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsFloatMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsFloatMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsFloat

instance O.OverloadedMethodInfo SpaJsonIsFloatMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsFloat",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsFloat"
        })


#endif

-- method SpaJson::is_int
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_int" wp_spa_json_is_int :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type int or not.
spaJsonIsInt ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type int, FALSE otherwise
spaJsonIsInt self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_int self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsIntMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsIntMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsInt

instance O.OverloadedMethodInfo SpaJsonIsIntMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsInt",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsInt"
        })


#endif

-- method SpaJson::is_null
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_null" wp_spa_json_is_null :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type null or not.
spaJsonIsNull ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type null, FALSE otherwise
spaJsonIsNull self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_null self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsNullMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsNullMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsNull

instance O.OverloadedMethodInfo SpaJsonIsNullMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsNull",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsNull"
        })


#endif

-- method SpaJson::is_object
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_object" wp_spa_json_is_object :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type object or not.
spaJsonIsObject ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type object, FALSE otherwise
spaJsonIsObject self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_object self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsObjectMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsObjectMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsObject

instance O.OverloadedMethodInfo SpaJsonIsObjectMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsObject",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsObject"
        })


#endif

-- method SpaJson::is_string
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_string" wp_spa_json_is_string :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether the spa json is of type string or not.
spaJsonIsString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if it is of type string, FALSE otherwise
spaJsonIsString self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_string self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsStringMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsStringMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsString

instance O.OverloadedMethodInfo SpaJsonIsStringMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsString",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsString"
        })


#endif

-- method SpaJson::is_unique_owner
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_is_unique_owner" wp_spa_json_is_unique_owner :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks if the json is the unique owner of its data or not.
spaJsonIsUniqueOwner ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m Bool
    -- ^ __Returns:__ TRUE if the json owns the data, FALSE otherwise.
spaJsonIsUniqueOwner self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_is_unique_owner self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonIsUniqueOwnerMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod SpaJsonIsUniqueOwnerMethodInfo SpaJson signature where
    overloadedMethod = spaJsonIsUniqueOwner

instance O.OverloadedMethodInfo SpaJsonIsUniqueOwnerMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonIsUniqueOwner",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonIsUniqueOwner"
        })


#endif

-- method SpaJson::new_iterator
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "Iterator" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_new_iterator" wp_spa_json_new_iterator :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO (Ptr Wp.Iterator.Iterator)

-- | Creates a new iterator for a spa json object.
spaJsonNewIterator ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m Wp.Iterator.Iterator
    -- ^ __Returns:__ the new spa json iterator
spaJsonNewIterator self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_new_iterator self'
    checkUnexpectedReturnNULL "spaJsonNewIterator" result
    result' <- (wrapBoxed Wp.Iterator.Iterator) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonNewIteratorMethodInfo
instance (signature ~ (m Wp.Iterator.Iterator), MonadIO m) => O.OverloadedMethod SpaJsonNewIteratorMethodInfo SpaJson signature where
    overloadedMethod = spaJsonNewIterator

instance O.OverloadedMethodInfo SpaJsonNewIteratorMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonNewIterator",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonNewIterator"
        })


#endif

-- method SpaJson::parse_boolean
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TBoolean
--           , argCType = Just "gboolean*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the boolean value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_parse_boolean" wp_spa_json_parse_boolean :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    Ptr CInt ->                             -- value : TBasicType TBoolean
    IO CInt

-- | Parses the boolean value of a spa json object.
spaJsonParseBoolean ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m ((Bool, Bool))
    -- ^ __Returns:__ TRUE if the value was obtained, FALSE otherwise
spaJsonParseBoolean self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    value <- allocMem :: IO (Ptr CInt)
    result <- wp_spa_json_parse_boolean self' value
    let result' = (/= 0) result
    value' <- peek value
    let value'' = (/= 0) value'
    touchManagedPtr self
    freeMem value
    return (result', value'')

#if defined(ENABLE_OVERLOADING)
data SpaJsonParseBooleanMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m) => O.OverloadedMethod SpaJsonParseBooleanMethodInfo SpaJson signature where
    overloadedMethod = spaJsonParseBoolean

instance O.OverloadedMethodInfo SpaJsonParseBooleanMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonParseBoolean",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonParseBoolean"
        })


#endif

-- method SpaJson::parse_float
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TFloat
--           , argCType = Just "float*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the float value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_parse_float" wp_spa_json_parse_float :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    Ptr CFloat ->                           -- value : TBasicType TFloat
    IO CInt

-- | Parses the float value of a spa json object.
spaJsonParseFloat ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m ((Bool, Float))
    -- ^ __Returns:__ TRUE if the value was obtained, FALSE otherwise
spaJsonParseFloat self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    value <- allocMem :: IO (Ptr CFloat)
    result <- wp_spa_json_parse_float self' value
    let result' = (/= 0) result
    value' <- peek value
    let value'' = realToFrac value'
    touchManagedPtr self
    freeMem value
    return (result', value'')

#if defined(ENABLE_OVERLOADING)
data SpaJsonParseFloatMethodInfo
instance (signature ~ (m ((Bool, Float))), MonadIO m) => O.OverloadedMethod SpaJsonParseFloatMethodInfo SpaJson signature where
    overloadedMethod = spaJsonParseFloat

instance O.OverloadedMethodInfo SpaJsonParseFloatMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonParseFloat",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonParseFloat"
        })


#endif

-- method SpaJson::parse_int
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TInt
--           , argCType = Just "gint*"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the int value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_parse_int" wp_spa_json_parse_int :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    Ptr Int32 ->                            -- value : TBasicType TInt
    IO CInt

-- | Parses the int value of a spa json object.
spaJsonParseInt ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m ((Bool, Int32))
    -- ^ __Returns:__ TRUE if the value was obtained, FALSE otherwise
spaJsonParseInt self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    value <- allocMem :: IO (Ptr Int32)
    result <- wp_spa_json_parse_int self' value
    let result' = (/= 0) result
    value' <- peek value
    touchManagedPtr self
    freeMem value
    return (result', value')

#if defined(ENABLE_OVERLOADING)
data SpaJsonParseIntMethodInfo
instance (signature ~ (m ((Bool, Int32))), MonadIO m) => O.OverloadedMethod SpaJsonParseIntMethodInfo SpaJson signature where
    overloadedMethod = spaJsonParseInt

instance O.OverloadedMethodInfo SpaJsonParseIntMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonParseInt",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonParseInt"
        })


#endif

-- method SpaJson::parse_string
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the spa json object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_parse_string" wp_spa_json_parse_string :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CString

-- | Parses the string value of a spa json object.
spaJsonParseString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: the spa json object
    -> m T.Text
    -- ^ __Returns:__ The newly allocated parsed string
spaJsonParseString self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_parse_string self'
    checkUnexpectedReturnNULL "spaJsonParseString" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonParseStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod SpaJsonParseStringMethodInfo SpaJson signature where
    overloadedMethod = spaJsonParseString

instance O.OverloadedMethodInfo SpaJsonParseStringMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonParseString",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonParseString"
        })


#endif

-- method SpaJson::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_ref" wp_spa_json_ref :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO (Ptr SpaJson)

-- | Increases the reference count of a spa json object.
spaJsonRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m SpaJson
    -- ^ __Returns:__ /@self@/ with an additional reference count on it
spaJsonRef self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_ref self'
    checkUnexpectedReturnNULL "spaJsonRef" result
    result' <- (wrapBoxed SpaJson) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonRefMethodInfo
instance (signature ~ (m SpaJson), MonadIO m) => O.OverloadedMethod SpaJsonRefMethodInfo SpaJson signature where
    overloadedMethod = spaJsonRef

instance O.OverloadedMethodInfo SpaJsonRefMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonRef"
        })


#endif

-- method SpaJson::to_string
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "const WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_to_string" wp_spa_json_to_string :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CString

-- | Returns a newly allocated json string with length matching the size.
-- 
-- /Since: 0.4.11/
spaJsonToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m T.Text
    -- ^ __Returns:__ the json string with length matching the size
spaJsonToString self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_spa_json_to_string self'
    checkUnexpectedReturnNULL "spaJsonToString" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SpaJsonToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod SpaJsonToStringMethodInfo SpaJson signature where
    overloadedMethod = spaJsonToString

instance O.OverloadedMethodInfo SpaJsonToStringMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonToString",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonToString"
        })


#endif

-- method SpaJson::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a spa json object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "wp_spa_json_unref" wp_spa_json_unref :: 
    Ptr SpaJson ->                          -- self : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO ()

-- | Decreases the reference count on /@self@/ and frees it when the ref count reaches zero.
spaJsonUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SpaJson
    -- ^ /@self@/: a spa json object
    -> m ()
spaJsonUnref self = liftIO $ do
    self' <- B.ManagedPtr.disownBoxed self
    wp_spa_json_unref self'
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data SpaJsonUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod SpaJsonUnrefMethodInfo SpaJson signature where
    overloadedMethod = spaJsonUnref

instance O.OverloadedMethodInfo SpaJsonUnrefMethodInfo SpaJson where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SpaJson.spaJsonUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14/docs/GI-Wp-Structs-SpaJson.html#v:spaJsonUnref"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSpaJsonMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSpaJsonMethod "copy" o = SpaJsonCopyMethodInfo
    ResolveSpaJsonMethod "ensureUniqueOwner" o = SpaJsonEnsureUniqueOwnerMethodInfo
    ResolveSpaJsonMethod "isArray" o = SpaJsonIsArrayMethodInfo
    ResolveSpaJsonMethod "isBoolean" o = SpaJsonIsBooleanMethodInfo
    ResolveSpaJsonMethod "isContainer" o = SpaJsonIsContainerMethodInfo
    ResolveSpaJsonMethod "isFloat" o = SpaJsonIsFloatMethodInfo
    ResolveSpaJsonMethod "isInt" o = SpaJsonIsIntMethodInfo
    ResolveSpaJsonMethod "isNull" o = SpaJsonIsNullMethodInfo
    ResolveSpaJsonMethod "isObject" o = SpaJsonIsObjectMethodInfo
    ResolveSpaJsonMethod "isString" o = SpaJsonIsStringMethodInfo
    ResolveSpaJsonMethod "isUniqueOwner" o = SpaJsonIsUniqueOwnerMethodInfo
    ResolveSpaJsonMethod "newIterator" o = SpaJsonNewIteratorMethodInfo
    ResolveSpaJsonMethod "parseBoolean" o = SpaJsonParseBooleanMethodInfo
    ResolveSpaJsonMethod "parseFloat" o = SpaJsonParseFloatMethodInfo
    ResolveSpaJsonMethod "parseInt" o = SpaJsonParseIntMethodInfo
    ResolveSpaJsonMethod "parseString" o = SpaJsonParseStringMethodInfo
    ResolveSpaJsonMethod "ref" o = SpaJsonRefMethodInfo
    ResolveSpaJsonMethod "toString" o = SpaJsonToStringMethodInfo
    ResolveSpaJsonMethod "unref" o = SpaJsonUnrefMethodInfo
    ResolveSpaJsonMethod "getData" o = SpaJsonGetDataMethodInfo
    ResolveSpaJsonMethod "getSize" o = SpaJsonGetSizeMethodInfo
    ResolveSpaJsonMethod "getSpaJson" o = SpaJsonGetSpaJsonMethodInfo
    ResolveSpaJsonMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif