{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Data stored locally by a web site.
-- 
-- WebKitWebsiteData represents data stored in the client by a particular website.
-- A website is normally a set of URLs grouped by domain name. You can get the website name,
-- which is usually the domain, with 'GI.WebKit.Structs.WebsiteData.websiteDataGetName'.
-- Documents loaded from the file system, like file:\/\/ URIs, are all grouped in the same WebKitWebsiteData
-- with the name \"Local files\".
-- 
-- A website can store different types of data in the client side. t'GI.WebKit.Flags.WebsiteDataTypes' is an enum containing
-- all the possible data types; use 'GI.WebKit.Structs.WebsiteData.websiteDataGetTypes' to get the bitmask of data types.
-- It\'s also possible to know the size of the data stored for some of the t'GI.WebKit.Flags.WebsiteDataTypes' by using
-- 'GI.WebKit.Structs.WebsiteData.websiteDataGetSize'.
-- 
-- A list of WebKitWebsiteData can be retrieved with 'GI.WebKit.Objects.WebsiteDataManager.websiteDataManagerFetch'. See t'GI.WebKit.Objects.WebsiteDataManager.WebsiteDataManager'
-- for more information.
-- 
-- /Since: 2.16/

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

module GI.WebKit.Structs.WebsiteData
    ( 

-- * Exported types
    WebsiteData(..)                         ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [ref]("GI.WebKit.Structs.WebsiteData#g:method:ref"), [unref]("GI.WebKit.Structs.WebsiteData#g:method:unref").
-- 
-- ==== Getters
-- [getName]("GI.WebKit.Structs.WebsiteData#g:method:getName"), [getSize]("GI.WebKit.Structs.WebsiteData#g:method:getSize"), [getTypes]("GI.WebKit.Structs.WebsiteData#g:method:getTypes").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveWebsiteDataMethod                ,
#endif

-- ** getName #method:getName#

#if defined(ENABLE_OVERLOADING)
    WebsiteDataGetNameMethodInfo            ,
#endif
    websiteDataGetName                      ,


-- ** getSize #method:getSize#

#if defined(ENABLE_OVERLOADING)
    WebsiteDataGetSizeMethodInfo            ,
#endif
    websiteDataGetSize                      ,


-- ** getTypes #method:getTypes#

#if defined(ENABLE_OVERLOADING)
    WebsiteDataGetTypesMethodInfo           ,
#endif
    websiteDataGetTypes                     ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    WebsiteDataRefMethodInfo                ,
#endif
    websiteDataRef                          ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    WebsiteDataUnrefMethodInfo              ,
#endif
    websiteDataUnref                        ,




    ) 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 {-# SOURCE #-} qualified GI.WebKit.Flags as WebKit.Flags

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

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

foreign import ccall "webkit_website_data_get_type" c_webkit_website_data_get_type :: 
    IO GType

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

instance B.Types.TypedObject WebsiteData where
    glibType :: IO GType
glibType = IO GType
c_webkit_website_data_get_type

instance B.Types.GBoxed WebsiteData

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


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

-- method WebsiteData::get_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "website_data"
--           , argType =
--               TInterface Name { namespace = "WebKit" , name = "WebsiteData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitWebsiteData"
--                 , 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 "webkit_website_data_get_name" webkit_website_data_get_name :: 
    Ptr WebsiteData ->                      -- website_data : TInterface (Name {namespace = "WebKit", name = "WebsiteData"})
    IO CString

-- | Gets the name of t'GI.WebKit.Structs.WebsiteData.WebsiteData'.
-- 
-- This is the website name, normally represented by
-- a domain or host name. All local documents are grouped in the same t'GI.WebKit.Structs.WebsiteData.WebsiteData' using
-- the name \"Local files\".
-- 
-- /Since: 2.16/
websiteDataGetName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    WebsiteData
    -- ^ /@websiteData@/: a t'GI.WebKit.Structs.WebsiteData.WebsiteData'
    -> m T.Text
    -- ^ __Returns:__ the website name of /@websiteData@/.
websiteDataGetName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
WebsiteData -> m Text
websiteDataGetName WebsiteData
websiteData = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsiteData
websiteData' <- WebsiteData -> IO (Ptr WebsiteData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr WebsiteData
websiteData
    CString
result <- Ptr WebsiteData -> IO CString
webkit_website_data_get_name Ptr WebsiteData
websiteData'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websiteDataGetName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    WebsiteData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr WebsiteData
websiteData
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data WebsiteDataGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod WebsiteDataGetNameMethodInfo WebsiteData signature where
    overloadedMethod = websiteDataGetName

instance O.OverloadedMethodInfo WebsiteDataGetNameMethodInfo WebsiteData where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.WebKit.Structs.WebsiteData.websiteDataGetName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit-6.0.2/docs/GI-WebKit-Structs-WebsiteData.html#v:websiteDataGetName"
        })


#endif

-- method WebsiteData::get_size
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "website_data"
--           , argType =
--               TInterface Name { namespace = "WebKit" , name = "WebsiteData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitWebsiteData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "types"
--           , argType =
--               TInterface
--                 Name { namespace = "WebKit" , name = "WebsiteDataTypes" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a bitmask  of #WebKitWebsiteDataTypes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_website_data_get_size" webkit_website_data_get_size :: 
    Ptr WebsiteData ->                      -- website_data : TInterface (Name {namespace = "WebKit", name = "WebsiteData"})
    CUInt ->                                -- types : TInterface (Name {namespace = "WebKit", name = "WebsiteDataTypes"})
    IO Word64

-- | Gets the size of the data of types /@types@/ in a t'GI.WebKit.Structs.WebsiteData.WebsiteData'.
-- 
-- Note that currently the data size is only known for 'GI.WebKit.Flags.WebsiteDataTypesDiskCache' data type
-- so for all other types 0 will be returned.
-- 
-- /Since: 2.16/
websiteDataGetSize ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    WebsiteData
    -- ^ /@websiteData@/: a t'GI.WebKit.Structs.WebsiteData.WebsiteData'
    -> [WebKit.Flags.WebsiteDataTypes]
    -- ^ /@types@/: a bitmask  of t'GI.WebKit.Flags.WebsiteDataTypes'
    -> m Word64
    -- ^ __Returns:__ the size of /@websiteData@/ for the given /@types@/.
websiteDataGetSize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
WebsiteData -> [WebsiteDataTypes] -> m Word64
websiteDataGetSize WebsiteData
websiteData [WebsiteDataTypes]
types = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsiteData
websiteData' <- WebsiteData -> IO (Ptr WebsiteData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr WebsiteData
websiteData
    let types' :: CUInt
types' = [WebsiteDataTypes] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [WebsiteDataTypes]
types
    Word64
result <- Ptr WebsiteData -> CUInt -> IO Word64
webkit_website_data_get_size Ptr WebsiteData
websiteData' CUInt
types'
    WebsiteData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr WebsiteData
websiteData
    Word64 -> IO Word64
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result

#if defined(ENABLE_OVERLOADING)
data WebsiteDataGetSizeMethodInfo
instance (signature ~ ([WebKit.Flags.WebsiteDataTypes] -> m Word64), MonadIO m) => O.OverloadedMethod WebsiteDataGetSizeMethodInfo WebsiteData signature where
    overloadedMethod = websiteDataGetSize

instance O.OverloadedMethodInfo WebsiteDataGetSizeMethodInfo WebsiteData where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.WebKit.Structs.WebsiteData.websiteDataGetSize",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit-6.0.2/docs/GI-WebKit-Structs-WebsiteData.html#v:websiteDataGetSize"
        })


#endif

-- method WebsiteData::get_types
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "website_data"
--           , argType =
--               TInterface Name { namespace = "WebKit" , name = "WebsiteData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitWebsiteData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "WebKit" , name = "WebsiteDataTypes" })
-- throws : False
-- Skip return : False

foreign import ccall "webkit_website_data_get_types" webkit_website_data_get_types :: 
    Ptr WebsiteData ->                      -- website_data : TInterface (Name {namespace = "WebKit", name = "WebsiteData"})
    IO CUInt

-- | Gets the types of data stored in the client for a t'GI.WebKit.Structs.WebsiteData.WebsiteData'.
-- 
-- These are the
-- types actually present, not the types queried with 'GI.WebKit.Objects.WebsiteDataManager.websiteDataManagerFetch'.
-- 
-- /Since: 2.16/
websiteDataGetTypes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    WebsiteData
    -- ^ /@websiteData@/: a t'GI.WebKit.Structs.WebsiteData.WebsiteData'
    -> m [WebKit.Flags.WebsiteDataTypes]
    -- ^ __Returns:__ a bitmask of t'GI.WebKit.Flags.WebsiteDataTypes' in /@websiteData@/
websiteDataGetTypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
WebsiteData -> m [WebsiteDataTypes]
websiteDataGetTypes WebsiteData
websiteData = IO [WebsiteDataTypes] -> m [WebsiteDataTypes]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [WebsiteDataTypes] -> m [WebsiteDataTypes])
-> IO [WebsiteDataTypes] -> m [WebsiteDataTypes]
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsiteData
websiteData' <- WebsiteData -> IO (Ptr WebsiteData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr WebsiteData
websiteData
    CUInt
result <- Ptr WebsiteData -> IO CUInt
webkit_website_data_get_types Ptr WebsiteData
websiteData'
    let result' :: [WebsiteDataTypes]
result' = CUInt -> [WebsiteDataTypes]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    WebsiteData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr WebsiteData
websiteData
    [WebsiteDataTypes] -> IO [WebsiteDataTypes]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [WebsiteDataTypes]
result'

#if defined(ENABLE_OVERLOADING)
data WebsiteDataGetTypesMethodInfo
instance (signature ~ (m [WebKit.Flags.WebsiteDataTypes]), MonadIO m) => O.OverloadedMethod WebsiteDataGetTypesMethodInfo WebsiteData signature where
    overloadedMethod = websiteDataGetTypes

instance O.OverloadedMethodInfo WebsiteDataGetTypesMethodInfo WebsiteData where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.WebKit.Structs.WebsiteData.websiteDataGetTypes",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit-6.0.2/docs/GI-WebKit-Structs-WebsiteData.html#v:websiteDataGetTypes"
        })


#endif

-- method WebsiteData::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "website_data"
--           , argType =
--               TInterface Name { namespace = "WebKit" , name = "WebsiteData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #WebKitWebsiteData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "WebKit" , name = "WebsiteData" })
-- throws : False
-- Skip return : False

foreign import ccall "webkit_website_data_ref" webkit_website_data_ref :: 
    Ptr WebsiteData ->                      -- website_data : TInterface (Name {namespace = "WebKit", name = "WebsiteData"})
    IO (Ptr WebsiteData)

-- | Atomically increments the reference count of /@websiteData@/ by one.
-- 
-- This function is MT-safe and may be called from any thread.
-- 
-- /Since: 2.16/
websiteDataRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    WebsiteData
    -- ^ /@websiteData@/: a t'GI.WebKit.Structs.WebsiteData.WebsiteData'
    -> m WebsiteData
    -- ^ __Returns:__ The passed t'GI.WebKit.Structs.WebsiteData.WebsiteData'
websiteDataRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
WebsiteData -> m WebsiteData
websiteDataRef WebsiteData
websiteData = IO WebsiteData -> m WebsiteData
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsiteData -> m WebsiteData)
-> IO WebsiteData -> m WebsiteData
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsiteData
websiteData' <- WebsiteData -> IO (Ptr WebsiteData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr WebsiteData
websiteData
    Ptr WebsiteData
result <- Ptr WebsiteData -> IO (Ptr WebsiteData)
webkit_website_data_ref Ptr WebsiteData
websiteData'
    Text -> Ptr WebsiteData -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"websiteDataRef" Ptr WebsiteData
result
    WebsiteData
result' <- ((ManagedPtr WebsiteData -> WebsiteData)
-> Ptr WebsiteData -> IO WebsiteData
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr WebsiteData -> WebsiteData
WebsiteData) Ptr WebsiteData
result
    WebsiteData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr WebsiteData
websiteData
    WebsiteData -> IO WebsiteData
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return WebsiteData
result'

#if defined(ENABLE_OVERLOADING)
data WebsiteDataRefMethodInfo
instance (signature ~ (m WebsiteData), MonadIO m) => O.OverloadedMethod WebsiteDataRefMethodInfo WebsiteData signature where
    overloadedMethod = websiteDataRef

instance O.OverloadedMethodInfo WebsiteDataRefMethodInfo WebsiteData where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.WebKit.Structs.WebsiteData.websiteDataRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit-6.0.2/docs/GI-WebKit-Structs-WebsiteData.html#v:websiteDataRef"
        })


#endif

-- method WebsiteData::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "website_data"
--           , argType =
--               TInterface Name { namespace = "WebKit" , name = "WebsiteData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #WebKitWebsiteData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_website_data_unref" webkit_website_data_unref :: 
    Ptr WebsiteData ->                      -- website_data : TInterface (Name {namespace = "WebKit", name = "WebsiteData"})
    IO ()

-- | Atomically decrements the reference count of /@websiteData@/ by one.
-- 
-- If the reference count drops to 0, all memory allocated by
-- t'GI.WebKit.Structs.WebsiteData.WebsiteData' is released. This function is MT-safe and may be
-- called from any thread.
-- 
-- /Since: 2.16/
websiteDataUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    WebsiteData
    -- ^ /@websiteData@/: A t'GI.WebKit.Structs.WebsiteData.WebsiteData'
    -> m ()
websiteDataUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
WebsiteData -> m ()
websiteDataUnref WebsiteData
websiteData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr WebsiteData
websiteData' <- WebsiteData -> IO (Ptr WebsiteData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr WebsiteData
websiteData
    Ptr WebsiteData -> IO ()
webkit_website_data_unref Ptr WebsiteData
websiteData'
    WebsiteData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr WebsiteData
websiteData
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data WebsiteDataUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod WebsiteDataUnrefMethodInfo WebsiteData signature where
    overloadedMethod = websiteDataUnref

instance O.OverloadedMethodInfo WebsiteDataUnrefMethodInfo WebsiteData where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.WebKit.Structs.WebsiteData.websiteDataUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit-6.0.2/docs/GI-WebKit-Structs-WebsiteData.html#v:websiteDataUnref"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveWebsiteDataMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveWebsiteDataMethod "ref" o = WebsiteDataRefMethodInfo
    ResolveWebsiteDataMethod "unref" o = WebsiteDataUnrefMethodInfo
    ResolveWebsiteDataMethod "getName" o = WebsiteDataGetNameMethodInfo
    ResolveWebsiteDataMethod "getSize" o = WebsiteDataGetSizeMethodInfo
    ResolveWebsiteDataMethod "getTypes" o = WebsiteDataGetTypesMethodInfo
    ResolveWebsiteDataMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif