{-# LANGUAGE TypeApplications #-}


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

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

module GI.Soup.Objects.AuthDigest
    ( 

-- * Exported types
    AuthDigest(..)                          ,
    IsAuthDigest                            ,
    toAuthDigest                            ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [authenticate]("GI.Soup.Objects.Auth#g:method:authenticate"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [canAuthenticate]("GI.Soup.Objects.Auth#g:method:canAuthenticate"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hasSavedPassword]("GI.Soup.Objects.Auth#g:method:hasSavedPassword"), [isAuthenticated]("GI.Soup.Objects.Auth#g:method:isAuthenticated"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isForProxy]("GI.Soup.Objects.Auth#g:method:isForProxy"), [isReady]("GI.Soup.Objects.Auth#g:method:isReady"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [savePassword]("GI.Soup.Objects.Auth#g:method:savePassword"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [update]("GI.Soup.Objects.Auth#g:method:update"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getAuthorization]("GI.Soup.Objects.Auth#g:method:getAuthorization"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getHost]("GI.Soup.Objects.Auth#g:method:getHost"), [getInfo]("GI.Soup.Objects.Auth#g:method:getInfo"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getProtectionSpace]("GI.Soup.Objects.Auth#g:method:getProtectionSpace"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getRealm]("GI.Soup.Objects.Auth#g:method:getRealm"), [getSavedPassword]("GI.Soup.Objects.Auth#g:method:getSavedPassword"), [getSavedUsers]("GI.Soup.Objects.Auth#g:method:getSavedUsers"), [getSchemeName]("GI.Soup.Objects.Auth#g:method:getSchemeName").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveAuthDigestMethod                 ,
#endif



    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth

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

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

foreign import ccall "soup_auth_digest_get_type"
    c_soup_auth_digest_get_type :: IO B.Types.GType

instance B.Types.TypedObject AuthDigest where
    glibType :: IO GType
glibType = IO GType
c_soup_auth_digest_get_type

instance B.Types.GObject AuthDigest

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

instance O.HasParentTypes AuthDigest
type instance O.ParentTypes AuthDigest = '[Soup.Auth.Auth, GObject.Object.Object]

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveAuthDigestMethod (t :: Symbol) (o :: *) :: * where
    ResolveAuthDigestMethod "authenticate" o = Soup.Auth.AuthAuthenticateMethodInfo
    ResolveAuthDigestMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAuthDigestMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAuthDigestMethod "canAuthenticate" o = Soup.Auth.AuthCanAuthenticateMethodInfo
    ResolveAuthDigestMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAuthDigestMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAuthDigestMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveAuthDigestMethod "hasSavedPassword" o = Soup.Auth.AuthHasSavedPasswordMethodInfo
    ResolveAuthDigestMethod "isAuthenticated" o = Soup.Auth.AuthIsAuthenticatedMethodInfo
    ResolveAuthDigestMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAuthDigestMethod "isForProxy" o = Soup.Auth.AuthIsForProxyMethodInfo
    ResolveAuthDigestMethod "isReady" o = Soup.Auth.AuthIsReadyMethodInfo
    ResolveAuthDigestMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAuthDigestMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAuthDigestMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveAuthDigestMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAuthDigestMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAuthDigestMethod "savePassword" o = Soup.Auth.AuthSavePasswordMethodInfo
    ResolveAuthDigestMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAuthDigestMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAuthDigestMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAuthDigestMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveAuthDigestMethod "update" o = Soup.Auth.AuthUpdateMethodInfo
    ResolveAuthDigestMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAuthDigestMethod "getAuthorization" o = Soup.Auth.AuthGetAuthorizationMethodInfo
    ResolveAuthDigestMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAuthDigestMethod "getHost" o = Soup.Auth.AuthGetHostMethodInfo
    ResolveAuthDigestMethod "getInfo" o = Soup.Auth.AuthGetInfoMethodInfo
    ResolveAuthDigestMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAuthDigestMethod "getProtectionSpace" o = Soup.Auth.AuthGetProtectionSpaceMethodInfo
    ResolveAuthDigestMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAuthDigestMethod "getRealm" o = Soup.Auth.AuthGetRealmMethodInfo
    ResolveAuthDigestMethod "getSavedPassword" o = Soup.Auth.AuthGetSavedPasswordMethodInfo
    ResolveAuthDigestMethod "getSavedUsers" o = Soup.Auth.AuthGetSavedUsersMethodInfo
    ResolveAuthDigestMethod "getSchemeName" o = Soup.Auth.AuthGetSchemeNameMethodInfo
    ResolveAuthDigestMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAuthDigestMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveAuthDigestMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAuthDigestMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AuthDigest
type instance O.AttributeList AuthDigest = AuthDigestAttributeList
type AuthDigestAttributeList = ('[ '("host", Soup.Auth.AuthHostPropertyInfo), '("isAuthenticated", Soup.Auth.AuthIsAuthenticatedPropertyInfo), '("isForProxy", Soup.Auth.AuthIsForProxyPropertyInfo), '("realm", Soup.Auth.AuthRealmPropertyInfo), '("schemeName", Soup.Auth.AuthSchemeNamePropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif