{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Soup.Objects.AuthDomain
    ( 

-- * Exported types
    AuthDomain(..)                          ,
    IsAuthDomain                            ,
    toAuthDomain                            ,
    noAuthDomain                            ,


 -- * Methods
-- ** accepts #method:accepts#
    AuthDomainAcceptsMethodInfo             ,
    authDomainAccepts                       ,


-- ** addPath #method:addPath#
    AuthDomainAddPathMethodInfo             ,
    authDomainAddPath                       ,


-- ** basicSetAuthCallback #method:basicSetAuthCallback#
    AuthDomainBasicSetAuthCallbackMethodInfo,
    authDomainBasicSetAuthCallback          ,


-- ** challenge #method:challenge#
    AuthDomainChallengeMethodInfo           ,
    authDomainChallenge                     ,


-- ** checkPassword #method:checkPassword#
    AuthDomainCheckPasswordMethodInfo       ,
    authDomainCheckPassword                 ,


-- ** covers #method:covers#
    AuthDomainCoversMethodInfo              ,
    authDomainCovers                        ,


-- ** digestSetAuthCallback #method:digestSetAuthCallback#
    AuthDomainDigestSetAuthCallbackMethodInfo,
    authDomainDigestSetAuthCallback         ,


-- ** getRealm #method:getRealm#
    AuthDomainGetRealmMethodInfo            ,
    authDomainGetRealm                      ,


-- ** removePath #method:removePath#
    AuthDomainRemovePathMethodInfo          ,
    authDomainRemovePath                    ,


-- ** setFilter #method:setFilter#
    AuthDomainSetFilterMethodInfo           ,
    authDomainSetFilter                     ,


-- ** setGenericAuthCallback #method:setGenericAuthCallback#
    AuthDomainSetGenericAuthCallbackMethodInfo,
    authDomainSetGenericAuthCallback        ,


-- ** tryGenericAuthCallback #method:tryGenericAuthCallback#
    AuthDomainTryGenericAuthCallbackMethodInfo,
    authDomainTryGenericAuthCallback        ,




 -- * Properties
-- ** addPath #attr:addPath#
    AuthDomainAddPathPropertyInfo           ,
    clearAuthDomainAddPath                  ,
    constructAuthDomainAddPath              ,
    setAuthDomainAddPath                    ,


-- ** filter #attr:filter#
    AuthDomainFilterPropertyInfo            ,
    authDomainFilter                        ,
    constructAuthDomainFilter               ,
    getAuthDomainFilter                     ,
    setAuthDomainFilter                     ,


-- ** filterData #attr:filterData#
    AuthDomainFilterDataPropertyInfo        ,
    authDomainFilterData                    ,
    constructAuthDomainFilterData           ,
    getAuthDomainFilterData                 ,
    setAuthDomainFilterData                 ,


-- ** genericAuthCallback #attr:genericAuthCallback#
    AuthDomainGenericAuthCallbackPropertyInfo,
    authDomainGenericAuthCallback           ,
    constructAuthDomainGenericAuthCallback  ,
    getAuthDomainGenericAuthCallback        ,
    setAuthDomainGenericAuthCallback        ,


-- ** genericAuthData #attr:genericAuthData#
    AuthDomainGenericAuthDataPropertyInfo   ,
    authDomainGenericAuthData               ,
    constructAuthDomainGenericAuthData      ,
    getAuthDomainGenericAuthData            ,
    setAuthDomainGenericAuthData            ,


-- ** proxy #attr:proxy#
    AuthDomainProxyPropertyInfo             ,
    authDomainProxy                         ,
    constructAuthDomainProxy                ,
    getAuthDomainProxy                      ,


-- ** realm #attr:realm#
    AuthDomainRealmPropertyInfo             ,
    authDomainRealm                         ,
    constructAuthDomainRealm                ,
    getAuthDomainRealm                      ,


-- ** removePath #attr:removePath#
    AuthDomainRemovePathPropertyInfo        ,
    clearAuthDomainRemovePath               ,
    constructAuthDomainRemovePath           ,
    setAuthDomainRemovePath                 ,




    ) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Soup.Callbacks as Soup.Callbacks
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message

newtype AuthDomain = AuthDomain (ManagedPtr AuthDomain)
foreign import ccall "soup_auth_domain_get_type"
    c_soup_auth_domain_get_type :: IO GType

instance GObject AuthDomain where
    gobjectType _ = c_soup_auth_domain_get_type
    

class GObject o => IsAuthDomain o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError AuthDomain a) =>
    IsAuthDomain a
#endif
instance IsAuthDomain AuthDomain
instance GObject.Object.IsObject AuthDomain

toAuthDomain :: IsAuthDomain o => o -> IO AuthDomain
toAuthDomain = unsafeCastTo AuthDomain

noAuthDomain :: Maybe AuthDomain
noAuthDomain = Nothing

type family ResolveAuthDomainMethod (t :: Symbol) (o :: *) :: * where
    ResolveAuthDomainMethod "accepts" o = AuthDomainAcceptsMethodInfo
    ResolveAuthDomainMethod "addPath" o = AuthDomainAddPathMethodInfo
    ResolveAuthDomainMethod "basicSetAuthCallback" o = AuthDomainBasicSetAuthCallbackMethodInfo
    ResolveAuthDomainMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAuthDomainMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAuthDomainMethod "challenge" o = AuthDomainChallengeMethodInfo
    ResolveAuthDomainMethod "checkPassword" o = AuthDomainCheckPasswordMethodInfo
    ResolveAuthDomainMethod "covers" o = AuthDomainCoversMethodInfo
    ResolveAuthDomainMethod "digestSetAuthCallback" o = AuthDomainDigestSetAuthCallbackMethodInfo
    ResolveAuthDomainMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAuthDomainMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAuthDomainMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAuthDomainMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAuthDomainMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAuthDomainMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveAuthDomainMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAuthDomainMethod "removePath" o = AuthDomainRemovePathMethodInfo
    ResolveAuthDomainMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveAuthDomainMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveAuthDomainMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAuthDomainMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAuthDomainMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAuthDomainMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAuthDomainMethod "tryGenericAuthCallback" o = AuthDomainTryGenericAuthCallbackMethodInfo
    ResolveAuthDomainMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveAuthDomainMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAuthDomainMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAuthDomainMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAuthDomainMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAuthDomainMethod "getRealm" o = AuthDomainGetRealmMethodInfo
    ResolveAuthDomainMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAuthDomainMethod "setFilter" o = AuthDomainSetFilterMethodInfo
    ResolveAuthDomainMethod "setGenericAuthCallback" o = AuthDomainSetGenericAuthCallbackMethodInfo
    ResolveAuthDomainMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAuthDomainMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveAuthDomainMethod t AuthDomain, O.MethodInfo info AuthDomain p) => O.IsLabelProxy t (AuthDomain -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAuthDomainMethod t AuthDomain, O.MethodInfo info AuthDomain p) => O.IsLabel t (AuthDomain -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "add-path"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyWritable]
   -- Nullable: (Nothing,Nothing)

setAuthDomainAddPath :: (MonadIO m, IsAuthDomain o) => o -> T.Text -> m ()
setAuthDomainAddPath obj val = liftIO $ setObjectPropertyString obj "add-path" (Just val)

constructAuthDomainAddPath :: (IsAuthDomain o) => T.Text -> IO (GValueConstruct o)
constructAuthDomainAddPath val = constructObjectPropertyString "add-path" (Just val)

clearAuthDomainAddPath :: (MonadIO m, IsAuthDomain o) => o -> m ()
clearAuthDomainAddPath obj = liftIO $ setObjectPropertyString obj "add-path" (Nothing :: Maybe T.Text)

data AuthDomainAddPathPropertyInfo
instance AttrInfo AuthDomainAddPathPropertyInfo where
    type AttrAllowedOps AuthDomainAddPathPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrClear]
    type AttrSetTypeConstraint AuthDomainAddPathPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint AuthDomainAddPathPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainAddPathPropertyInfo = ()
    type AttrLabel AuthDomainAddPathPropertyInfo = "add-path"
    type AttrOrigin AuthDomainAddPathPropertyInfo = AuthDomain
    attrGet _ = undefined
    attrSet _ = setAuthDomainAddPath
    attrConstruct _ = constructAuthDomainAddPath
    attrClear _ = clearAuthDomainAddPath

-- VVV Prop "filter"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getAuthDomainFilter :: (MonadIO m, IsAuthDomain o) => o -> m (Ptr ())
getAuthDomainFilter obj = liftIO $ getObjectPropertyPtr obj "filter"

setAuthDomainFilter :: (MonadIO m, IsAuthDomain o) => o -> Ptr () -> m ()
setAuthDomainFilter obj val = liftIO $ setObjectPropertyPtr obj "filter" val

constructAuthDomainFilter :: (IsAuthDomain o) => Ptr () -> IO (GValueConstruct o)
constructAuthDomainFilter val = constructObjectPropertyPtr "filter" val

data AuthDomainFilterPropertyInfo
instance AttrInfo AuthDomainFilterPropertyInfo where
    type AttrAllowedOps AuthDomainFilterPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AuthDomainFilterPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint AuthDomainFilterPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainFilterPropertyInfo = (Ptr ())
    type AttrLabel AuthDomainFilterPropertyInfo = "filter"
    type AttrOrigin AuthDomainFilterPropertyInfo = AuthDomain
    attrGet _ = getAuthDomainFilter
    attrSet _ = setAuthDomainFilter
    attrConstruct _ = constructAuthDomainFilter
    attrClear _ = undefined

-- VVV Prop "filter-data"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getAuthDomainFilterData :: (MonadIO m, IsAuthDomain o) => o -> m (Ptr ())
getAuthDomainFilterData obj = liftIO $ getObjectPropertyPtr obj "filter-data"

setAuthDomainFilterData :: (MonadIO m, IsAuthDomain o) => o -> Ptr () -> m ()
setAuthDomainFilterData obj val = liftIO $ setObjectPropertyPtr obj "filter-data" val

constructAuthDomainFilterData :: (IsAuthDomain o) => Ptr () -> IO (GValueConstruct o)
constructAuthDomainFilterData val = constructObjectPropertyPtr "filter-data" val

data AuthDomainFilterDataPropertyInfo
instance AttrInfo AuthDomainFilterDataPropertyInfo where
    type AttrAllowedOps AuthDomainFilterDataPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AuthDomainFilterDataPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint AuthDomainFilterDataPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainFilterDataPropertyInfo = (Ptr ())
    type AttrLabel AuthDomainFilterDataPropertyInfo = "filter-data"
    type AttrOrigin AuthDomainFilterDataPropertyInfo = AuthDomain
    attrGet _ = getAuthDomainFilterData
    attrSet _ = setAuthDomainFilterData
    attrConstruct _ = constructAuthDomainFilterData
    attrClear _ = undefined

-- VVV Prop "generic-auth-callback"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getAuthDomainGenericAuthCallback :: (MonadIO m, IsAuthDomain o) => o -> m (Ptr ())
getAuthDomainGenericAuthCallback obj = liftIO $ getObjectPropertyPtr obj "generic-auth-callback"

setAuthDomainGenericAuthCallback :: (MonadIO m, IsAuthDomain o) => o -> Ptr () -> m ()
setAuthDomainGenericAuthCallback obj val = liftIO $ setObjectPropertyPtr obj "generic-auth-callback" val

constructAuthDomainGenericAuthCallback :: (IsAuthDomain o) => Ptr () -> IO (GValueConstruct o)
constructAuthDomainGenericAuthCallback val = constructObjectPropertyPtr "generic-auth-callback" val

data AuthDomainGenericAuthCallbackPropertyInfo
instance AttrInfo AuthDomainGenericAuthCallbackPropertyInfo where
    type AttrAllowedOps AuthDomainGenericAuthCallbackPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AuthDomainGenericAuthCallbackPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint AuthDomainGenericAuthCallbackPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainGenericAuthCallbackPropertyInfo = (Ptr ())
    type AttrLabel AuthDomainGenericAuthCallbackPropertyInfo = "generic-auth-callback"
    type AttrOrigin AuthDomainGenericAuthCallbackPropertyInfo = AuthDomain
    attrGet _ = getAuthDomainGenericAuthCallback
    attrSet _ = setAuthDomainGenericAuthCallback
    attrConstruct _ = constructAuthDomainGenericAuthCallback
    attrClear _ = undefined

-- VVV Prop "generic-auth-data"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getAuthDomainGenericAuthData :: (MonadIO m, IsAuthDomain o) => o -> m (Ptr ())
getAuthDomainGenericAuthData obj = liftIO $ getObjectPropertyPtr obj "generic-auth-data"

setAuthDomainGenericAuthData :: (MonadIO m, IsAuthDomain o) => o -> Ptr () -> m ()
setAuthDomainGenericAuthData obj val = liftIO $ setObjectPropertyPtr obj "generic-auth-data" val

constructAuthDomainGenericAuthData :: (IsAuthDomain o) => Ptr () -> IO (GValueConstruct o)
constructAuthDomainGenericAuthData val = constructObjectPropertyPtr "generic-auth-data" val

data AuthDomainGenericAuthDataPropertyInfo
instance AttrInfo AuthDomainGenericAuthDataPropertyInfo where
    type AttrAllowedOps AuthDomainGenericAuthDataPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AuthDomainGenericAuthDataPropertyInfo = (~) (Ptr ())
    type AttrBaseTypeConstraint AuthDomainGenericAuthDataPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainGenericAuthDataPropertyInfo = (Ptr ())
    type AttrLabel AuthDomainGenericAuthDataPropertyInfo = "generic-auth-data"
    type AttrOrigin AuthDomainGenericAuthDataPropertyInfo = AuthDomain
    attrGet _ = getAuthDomainGenericAuthData
    attrSet _ = setAuthDomainGenericAuthData
    attrConstruct _ = constructAuthDomainGenericAuthData
    attrClear _ = undefined

-- VVV Prop "proxy"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getAuthDomainProxy :: (MonadIO m, IsAuthDomain o) => o -> m Bool
getAuthDomainProxy obj = liftIO $ getObjectPropertyBool obj "proxy"

constructAuthDomainProxy :: (IsAuthDomain o) => Bool -> IO (GValueConstruct o)
constructAuthDomainProxy val = constructObjectPropertyBool "proxy" val

data AuthDomainProxyPropertyInfo
instance AttrInfo AuthDomainProxyPropertyInfo where
    type AttrAllowedOps AuthDomainProxyPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AuthDomainProxyPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint AuthDomainProxyPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainProxyPropertyInfo = Bool
    type AttrLabel AuthDomainProxyPropertyInfo = "proxy"
    type AttrOrigin AuthDomainProxyPropertyInfo = AuthDomain
    attrGet _ = getAuthDomainProxy
    attrSet _ = undefined
    attrConstruct _ = constructAuthDomainProxy
    attrClear _ = undefined

-- VVV Prop "realm"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getAuthDomainRealm :: (MonadIO m, IsAuthDomain o) => o -> m T.Text
getAuthDomainRealm obj = liftIO $ checkUnexpectedNothing "getAuthDomainRealm" $ getObjectPropertyString obj "realm"

constructAuthDomainRealm :: (IsAuthDomain o) => T.Text -> IO (GValueConstruct o)
constructAuthDomainRealm val = constructObjectPropertyString "realm" (Just val)

data AuthDomainRealmPropertyInfo
instance AttrInfo AuthDomainRealmPropertyInfo where
    type AttrAllowedOps AuthDomainRealmPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint AuthDomainRealmPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint AuthDomainRealmPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainRealmPropertyInfo = T.Text
    type AttrLabel AuthDomainRealmPropertyInfo = "realm"
    type AttrOrigin AuthDomainRealmPropertyInfo = AuthDomain
    attrGet _ = getAuthDomainRealm
    attrSet _ = undefined
    attrConstruct _ = constructAuthDomainRealm
    attrClear _ = undefined

-- VVV Prop "remove-path"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyWritable]
   -- Nullable: (Nothing,Nothing)

setAuthDomainRemovePath :: (MonadIO m, IsAuthDomain o) => o -> T.Text -> m ()
setAuthDomainRemovePath obj val = liftIO $ setObjectPropertyString obj "remove-path" (Just val)

constructAuthDomainRemovePath :: (IsAuthDomain o) => T.Text -> IO (GValueConstruct o)
constructAuthDomainRemovePath val = constructObjectPropertyString "remove-path" (Just val)

clearAuthDomainRemovePath :: (MonadIO m, IsAuthDomain o) => o -> m ()
clearAuthDomainRemovePath obj = liftIO $ setObjectPropertyString obj "remove-path" (Nothing :: Maybe T.Text)

data AuthDomainRemovePathPropertyInfo
instance AttrInfo AuthDomainRemovePathPropertyInfo where
    type AttrAllowedOps AuthDomainRemovePathPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrClear]
    type AttrSetTypeConstraint AuthDomainRemovePathPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint AuthDomainRemovePathPropertyInfo = IsAuthDomain
    type AttrGetType AuthDomainRemovePathPropertyInfo = ()
    type AttrLabel AuthDomainRemovePathPropertyInfo = "remove-path"
    type AttrOrigin AuthDomainRemovePathPropertyInfo = AuthDomain
    attrGet _ = undefined
    attrSet _ = setAuthDomainRemovePath
    attrConstruct _ = constructAuthDomainRemovePath
    attrClear _ = clearAuthDomainRemovePath

instance O.HasAttributeList AuthDomain
type instance O.AttributeList AuthDomain = AuthDomainAttributeList
type AuthDomainAttributeList = ('[ '("addPath", AuthDomainAddPathPropertyInfo), '("filter", AuthDomainFilterPropertyInfo), '("filterData", AuthDomainFilterDataPropertyInfo), '("genericAuthCallback", AuthDomainGenericAuthCallbackPropertyInfo), '("genericAuthData", AuthDomainGenericAuthDataPropertyInfo), '("proxy", AuthDomainProxyPropertyInfo), '("realm", AuthDomainRealmPropertyInfo), '("removePath", AuthDomainRemovePathPropertyInfo)] :: [(Symbol, *)])

authDomainFilter :: AttrLabelProxy "filter"
authDomainFilter = AttrLabelProxy

authDomainFilterData :: AttrLabelProxy "filterData"
authDomainFilterData = AttrLabelProxy

authDomainGenericAuthCallback :: AttrLabelProxy "genericAuthCallback"
authDomainGenericAuthCallback = AttrLabelProxy

authDomainGenericAuthData :: AttrLabelProxy "genericAuthData"
authDomainGenericAuthData = AttrLabelProxy

authDomainProxy :: AttrLabelProxy "proxy"
authDomainProxy = AttrLabelProxy

authDomainRealm :: AttrLabelProxy "realm"
authDomainRealm = AttrLabelProxy

type instance O.SignalList AuthDomain = AuthDomainSignalList
type AuthDomainSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

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

foreign import ccall "soup_auth_domain_accepts" soup_auth_domain_accepts :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO CString

{- |
Checks if /@msg@/ contains appropriate authorization for /@domain@/ to
accept it. Mirroring 'GI.Soup.Objects.AuthDomain.authDomainCovers', this does not check
whether or not /@domain@/ \<emphasis>cares\<\/emphasis> if /@msg@/ is
authorized.

This is used by 'GI.Soup.Objects.Server.Server' internally and is probably of no use to
anyone else.
-}
authDomainAccepts ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> b
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ the username that /@msg@/ has authenticated
as, if in fact it has authenticated. 'Nothing' otherwise. -}
authDomainAccepts domain msg = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_auth_domain_accepts domain' msg'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr domain
    touchManagedPtr msg
    return maybeResult

data AuthDomainAcceptsMethodInfo
instance (signature ~ (b -> m (Maybe T.Text)), MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) => O.MethodInfo AuthDomainAcceptsMethodInfo a signature where
    overloadedMethod _ = authDomainAccepts

-- method AuthDomain::add_path
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupAuthDomain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the path to add to @domain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_add_path" soup_auth_domain_add_path :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    CString ->                              -- path : TBasicType TUTF8
    IO ()

{- |
Adds /@path@/ to /@domain@/, such that requests under /@path@/ on /@domain@/\'s
server will require authentication (unless overridden by
'GI.Soup.Objects.AuthDomain.authDomainRemovePath' or 'GI.Soup.Objects.AuthDomain.authDomainSetFilter').

You can also add paths by setting the 'GI.Soup.Constants.AUTH_DOMAIN_ADD_PATH'
property, which can also be used to add one or more paths at
construct time.
-}
authDomainAddPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> T.Text
    {- ^ /@path@/: the path to add to /@domain@/ -}
    -> m ()
authDomainAddPath domain path = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    path' <- textToCString path
    soup_auth_domain_add_path domain' path'
    touchManagedPtr domain
    freeMem path'
    return ()

data AuthDomainAddPathMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAuthDomain a) => O.MethodInfo AuthDomainAddPathMethodInfo a signature where
    overloadedMethod _ = authDomainAddPath

-- method AuthDomain::basic_set_auth_callback
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the domain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Soup", name = "AuthDomainBasicAuthCallback"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the callback", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to @auth_callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dnotify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "destroy notifier to free @user_data when @domain\nis destroyed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_basic_set_auth_callback" soup_auth_domain_basic_set_auth_callback :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    FunPtr Soup.Callbacks.C_AuthDomainBasicAuthCallback -> -- callback : TInterface (Name {namespace = "Soup", name = "AuthDomainBasicAuthCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- dnotify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Sets the callback that /@domain@/ will use to authenticate incoming
requests. For each request containing authorization, /@domain@/ will
invoke the callback, and then either accept or reject the request
based on /@callback@/\'s return value.

You can also set the auth callback by setting the
'GI.Soup.Constants.AUTH_DOMAIN_BASIC_AUTH_CALLBACK' and
'GI.Soup.Constants.AUTH_DOMAIN_BASIC_AUTH_DATA' properties, which can also be
used to set the callback at construct time.
-}
authDomainBasicSetAuthCallback ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a) =>
    a
    {- ^ /@domain@/: the domain -}
    -> Soup.Callbacks.AuthDomainBasicAuthCallback
    {- ^ /@callback@/: the callback -}
    -> m ()
authDomainBasicSetAuthCallback domain callback = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    callback' <- Soup.Callbacks.mk_AuthDomainBasicAuthCallback (Soup.Callbacks.wrap_AuthDomainBasicAuthCallback Nothing (Soup.Callbacks.drop_closures_AuthDomainBasicAuthCallback callback))
    let userData = castFunPtrToPtr callback'
    let dnotify = safeFreeFunPtrPtr
    soup_auth_domain_basic_set_auth_callback domain' callback' userData dnotify
    touchManagedPtr domain
    return ()

data AuthDomainBasicSetAuthCallbackMethodInfo
instance (signature ~ (Soup.Callbacks.AuthDomainBasicAuthCallback -> m ()), MonadIO m, IsAuthDomain a) => O.MethodInfo AuthDomainBasicSetAuthCallbackMethodInfo a signature where
    overloadedMethod _ = authDomainBasicSetAuthCallback

-- method AuthDomain::challenge
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupAuthDomain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupMessage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_challenge" soup_auth_domain_challenge :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO ()

{- |
Adds a \"WWW-Authenticate\" or \"Proxy-Authenticate\" header to /@msg@/,
requesting that the client authenticate, and sets /@msg@/\'s status
accordingly.

This is used by 'GI.Soup.Objects.Server.Server' internally and is probably of no use to
anyone else.
-}
authDomainChallenge ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> b
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m ()
authDomainChallenge domain msg = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    msg' <- unsafeManagedPtrCastPtr msg
    soup_auth_domain_challenge domain' msg'
    touchManagedPtr domain
    touchManagedPtr msg
    return ()

data AuthDomainChallengeMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) => O.MethodInfo AuthDomainChallengeMethodInfo a signature where
    overloadedMethod _ = authDomainChallenge

-- method AuthDomain::check_password
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupAuthDomain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupMessage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "username", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a username", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "password", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a password", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_check_password" soup_auth_domain_check_password :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CString ->                              -- username : TBasicType TUTF8
    CString ->                              -- password : TBasicType TUTF8
    IO CInt

{- |
Checks if /@msg@/ authenticates to /@domain@/ via /@username@/ and
/@password@/. This would normally be called from a
'GI.Soup.Callbacks.AuthDomainGenericAuthCallback'.
-}
authDomainCheckPassword ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> b
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> T.Text
    {- ^ /@username@/: a username -}
    -> T.Text
    {- ^ /@password@/: a password -}
    -> m Bool
    {- ^ __Returns:__ whether or not the message is authenticated -}
authDomainCheckPassword domain msg username password = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    msg' <- unsafeManagedPtrCastPtr msg
    username' <- textToCString username
    password' <- textToCString password
    result <- soup_auth_domain_check_password domain' msg' username' password'
    let result' = (/= 0) result
    touchManagedPtr domain
    touchManagedPtr msg
    freeMem username'
    freeMem password'
    return result'

data AuthDomainCheckPasswordMethodInfo
instance (signature ~ (b -> T.Text -> T.Text -> m Bool), MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) => O.MethodInfo AuthDomainCheckPasswordMethodInfo a signature where
    overloadedMethod _ = authDomainCheckPassword

-- method AuthDomain::covers
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupAuthDomain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupMessage", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_covers" soup_auth_domain_covers :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO CInt

{- |
Checks if /@domain@/ requires /@msg@/ to be authenticated (according to
its paths and filter function). This does not actually look at
whether /@msg@/ \<emphasis>is\<\/emphasis> authenticated, merely whether
or not it needs to be.

This is used by 'GI.Soup.Objects.Server.Server' internally and is probably of no use to
anyone else.
-}
authDomainCovers ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> b
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@domain@/ requires /@msg@/ to be authenticated -}
authDomainCovers domain msg = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_auth_domain_covers domain' msg'
    let result' = (/= 0) result
    touchManagedPtr domain
    touchManagedPtr msg
    return result'

data AuthDomainCoversMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) => O.MethodInfo AuthDomainCoversMethodInfo a signature where
    overloadedMethod _ = authDomainCovers

-- method AuthDomain::digest_set_auth_callback
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the domain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Soup", name = "AuthDomainDigestAuthCallback"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the callback", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to @auth_callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dnotify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "destroy notifier to free @user_data when @domain\nis destroyed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_digest_set_auth_callback" soup_auth_domain_digest_set_auth_callback :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    FunPtr Soup.Callbacks.C_AuthDomainDigestAuthCallback -> -- callback : TInterface (Name {namespace = "Soup", name = "AuthDomainDigestAuthCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- dnotify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Sets the callback that /@domain@/ will use to authenticate incoming
requests. For each request containing authorization, /@domain@/ will
invoke the callback, and then either accept or reject the request
based on /@callback@/\'s return value.

You can also set the auth callback by setting the
'GI.Soup.Constants.AUTH_DOMAIN_DIGEST_AUTH_CALLBACK' and
'GI.Soup.Constants.AUTH_DOMAIN_DIGEST_AUTH_DATA' properties, which can also be
used to set the callback at construct time.
-}
authDomainDigestSetAuthCallback ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a) =>
    a
    {- ^ /@domain@/: the domain -}
    -> Soup.Callbacks.AuthDomainDigestAuthCallback
    {- ^ /@callback@/: the callback -}
    -> m ()
authDomainDigestSetAuthCallback domain callback = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    callback' <- Soup.Callbacks.mk_AuthDomainDigestAuthCallback (Soup.Callbacks.wrap_AuthDomainDigestAuthCallback Nothing (Soup.Callbacks.drop_closures_AuthDomainDigestAuthCallback callback))
    let userData = castFunPtrToPtr callback'
    let dnotify = safeFreeFunPtrPtr
    soup_auth_domain_digest_set_auth_callback domain' callback' userData dnotify
    touchManagedPtr domain
    return ()

data AuthDomainDigestSetAuthCallbackMethodInfo
instance (signature ~ (Soup.Callbacks.AuthDomainDigestAuthCallback -> m ()), MonadIO m, IsAuthDomain a) => O.MethodInfo AuthDomainDigestSetAuthCallbackMethodInfo a signature where
    overloadedMethod _ = authDomainDigestSetAuthCallback

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

foreign import ccall "soup_auth_domain_get_realm" soup_auth_domain_get_realm :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    IO CString

{- |
Gets the realm name associated with /@domain@/
-}
authDomainGetRealm ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> m T.Text
    {- ^ __Returns:__ /@domain@/\'s realm -}
authDomainGetRealm domain = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    result <- soup_auth_domain_get_realm domain'
    checkUnexpectedReturnNULL "authDomainGetRealm" result
    result' <- cstringToText result
    touchManagedPtr domain
    return result'

data AuthDomainGetRealmMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuthDomain a) => O.MethodInfo AuthDomainGetRealmMethodInfo a signature where
    overloadedMethod _ = authDomainGetRealm

-- method AuthDomain::remove_path
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupAuthDomain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the path to remove from @domain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_remove_path" soup_auth_domain_remove_path :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    CString ->                              -- path : TBasicType TUTF8
    IO ()

{- |
Removes /@path@/ from /@domain@/, such that requests under /@path@/ on
/@domain@/\'s server will NOT require authentication.

This is not simply an undo-er for 'GI.Soup.Objects.AuthDomain.authDomainAddPath'; it
can be used to \"carve out\" a subtree that does not require
authentication inside a hierarchy that does. Note also that unlike
with 'GI.Soup.Objects.AuthDomain.authDomainAddPath', this cannot be overridden by
adding a filter, as filters can only bypass authentication that
would otherwise be required, not require it where it would
otherwise be unnecessary.

You can also remove paths by setting the
'GI.Soup.Constants.AUTH_DOMAIN_REMOVE_PATH' property, which can also be used to
remove one or more paths at construct time.
-}
authDomainRemovePath ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> T.Text
    {- ^ /@path@/: the path to remove from /@domain@/ -}
    -> m ()
authDomainRemovePath domain path = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    path' <- textToCString path
    soup_auth_domain_remove_path domain' path'
    touchManagedPtr domain
    freeMem path'
    return ()

data AuthDomainRemovePathMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAuthDomain a) => O.MethodInfo AuthDomainRemovePathMethodInfo a signature where
    overloadedMethod _ = authDomainRemovePath

-- method AuthDomain::set_filter
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupAuthDomain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filter", argType = TInterface (Name {namespace = "Soup", name = "AuthDomainFilter"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the auth filter for @domain", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "filter_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to @filter", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dnotify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "destroy notifier to free @filter_data when @domain\nis destroyed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_set_filter" soup_auth_domain_set_filter :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    FunPtr Soup.Callbacks.C_AuthDomainFilter -> -- filter : TInterface (Name {namespace = "Soup", name = "AuthDomainFilter"})
    Ptr () ->                               -- filter_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- dnotify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Adds /@filter@/ as an authentication filter to /@domain@/. The filter
gets a chance to bypass authentication for certain requests that
would otherwise require it. Eg, it might check the message\'s path
in some way that is too complicated to do via the other methods, or
it might check the message\'s method, and allow GETs but not PUTs.

The filter function returns 'True' if the request should still
require authentication, or 'False' if authentication is unnecessary
for this request.

To help prevent security holes, your filter should return 'True' by
default, and only return 'False' under specifically-tested
circumstances, rather than the other way around. Eg, in the example
above, where you want to authenticate PUTs but not GETs, you should
check if the method is GET and return 'False' in that case, and then
return 'True' for all other methods (rather than returning 'True' for
PUT and 'False' for all other methods). This way if it turned out
(now or later) that some paths supported additional methods besides
GET and PUT, those methods would default to being NOT allowed for
unauthenticated users.

You can also set the filter by setting the 'GI.Soup.Constants.AUTH_DOMAIN_FILTER'
and 'GI.Soup.Constants.AUTH_DOMAIN_FILTER_DATA' properties, which can also be
used to set the filter at construct time.
-}
authDomainSetFilter ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> Soup.Callbacks.AuthDomainFilter
    {- ^ /@filter@/: the auth filter for /@domain@/ -}
    -> m ()
authDomainSetFilter domain filter = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    filter' <- Soup.Callbacks.mk_AuthDomainFilter (Soup.Callbacks.wrap_AuthDomainFilter Nothing (Soup.Callbacks.drop_closures_AuthDomainFilter filter))
    let filterData = castFunPtrToPtr filter'
    let dnotify = safeFreeFunPtrPtr
    soup_auth_domain_set_filter domain' filter' filterData dnotify
    touchManagedPtr domain
    return ()

data AuthDomainSetFilterMethodInfo
instance (signature ~ (Soup.Callbacks.AuthDomainFilter -> m ()), MonadIO m, IsAuthDomain a) => O.MethodInfo AuthDomainSetFilterMethodInfo a signature where
    overloadedMethod _ = authDomainSetFilter

-- method AuthDomain::set_generic_auth_callback
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupAuthDomain", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "auth_callback", argType = TInterface (Name {namespace = "Soup", name = "AuthDomainGenericAuthCallback"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the auth callback", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "auth_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to @auth_callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dnotify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "destroy notifier to free @auth_data when @domain\nis destroyed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_set_generic_auth_callback" soup_auth_domain_set_generic_auth_callback :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    FunPtr Soup.Callbacks.C_AuthDomainGenericAuthCallback -> -- auth_callback : TInterface (Name {namespace = "Soup", name = "AuthDomainGenericAuthCallback"})
    Ptr () ->                               -- auth_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- dnotify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Sets /@authCallback@/ as an authentication-handling callback for
/@domain@/. Whenever a request comes in to /@domain@/ which cannot be
authenticated via a domain-specific auth callback (eg,
'GI.Soup.Callbacks.AuthDomainDigestAuthCallback'), the generic auth callback
will be invoked. See 'GI.Soup.Callbacks.AuthDomainGenericAuthCallback' for information
on what the callback should do.
-}
authDomainSetGenericAuthCallback ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a) =>
    a
    {- ^ /@domain@/: a 'GI.Soup.Objects.AuthDomain.AuthDomain' -}
    -> Soup.Callbacks.AuthDomainGenericAuthCallback
    {- ^ /@authCallback@/: the auth callback -}
    -> m ()
authDomainSetGenericAuthCallback domain authCallback = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    authCallback' <- Soup.Callbacks.mk_AuthDomainGenericAuthCallback (Soup.Callbacks.wrap_AuthDomainGenericAuthCallback Nothing (Soup.Callbacks.drop_closures_AuthDomainGenericAuthCallback authCallback))
    let authData = castFunPtrToPtr authCallback'
    let dnotify = safeFreeFunPtrPtr
    soup_auth_domain_set_generic_auth_callback domain' authCallback' authData dnotify
    touchManagedPtr domain
    return ()

data AuthDomainSetGenericAuthCallbackMethodInfo
instance (signature ~ (Soup.Callbacks.AuthDomainGenericAuthCallback -> m ()), MonadIO m, IsAuthDomain a) => O.MethodInfo AuthDomainSetGenericAuthCallbackMethodInfo a signature where
    overloadedMethod _ = authDomainSetGenericAuthCallback

-- method AuthDomain::try_generic_auth_callback
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "domain", argType = TInterface (Name {namespace = "Soup", name = "AuthDomain"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "username", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "soup_auth_domain_try_generic_auth_callback" soup_auth_domain_try_generic_auth_callback :: 
    Ptr AuthDomain ->                       -- domain : TInterface (Name {namespace = "Soup", name = "AuthDomain"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CString ->                              -- username : TBasicType TUTF8
    IO CInt

{- |
/No description available in the introspection data./
-}
authDomainTryGenericAuthCallback ::
    (B.CallStack.HasCallStack, MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) =>
    a
    -> b
    -> T.Text
    -> m Bool
authDomainTryGenericAuthCallback domain msg username = liftIO $ do
    domain' <- unsafeManagedPtrCastPtr domain
    msg' <- unsafeManagedPtrCastPtr msg
    username' <- textToCString username
    result <- soup_auth_domain_try_generic_auth_callback domain' msg' username'
    let result' = (/= 0) result
    touchManagedPtr domain
    touchManagedPtr msg
    freeMem username'
    return result'

data AuthDomainTryGenericAuthCallbackMethodInfo
instance (signature ~ (b -> T.Text -> m Bool), MonadIO m, IsAuthDomain a, Soup.Message.IsMessage b) => O.MethodInfo AuthDomainTryGenericAuthCallbackMethodInfo a signature where
    overloadedMethod _ = authDomainTryGenericAuthCallback